rpms/kernel-xen-2.6/devel linux-2.6-xen-0156-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch, NONE, 1.1 kernel.spec, 1.36, 1.37

Eduardo Habkost (ehabkost) fedora-extras-commits at redhat.com
Tue Apr 15 22:33:16 UTC 2008


Author: ehabkost

Update of /cvs/pkgs/rpms/kernel-xen-2.6/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27001

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-xen-0156-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch 
Log Message:
Fix free_init_pages() to unmap pages from __START_KERNEL_map (bug #441543)


linux-2.6-xen-0156-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch:

--- NEW FILE linux-2.6-xen-0156-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch ---
>From 9ee9833fcc88cf1196e959b7f6342897f9df043b Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost at redhat.com>
Date: Tue, 15 Apr 2008 17:59:31 -0300
Subject: [PATCH] Xen: Clear __START_KERNEL_map PTEs on free_init_pages() (REVIEWME)

We need to kill the __START_KERNEL_map aliases of the freed init pages
otherwise we won't be able to pin those pages as pagetables later, because
there will be a read-write alias even after make_lowpage_readonly().

Probably using set_memory_ro() instead of make_lowpage_readonly()
when pinning pages will be better.

This should fix the pagetable pinning problems reported at
https://bugzilla.redhat.com/show_bug.cgi?id=441543

Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
---
 arch/x86/mm/init_64.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 494f141..243bdf3 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1093,6 +1093,16 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
 			POISON_FREE_INITMEM, PAGE_SIZE);
 		free_page(addr);
 		totalram_pages++;
+		if (begin >= __START_KERNEL_map) {
+			pte_t *kpte;
+			unsigned int l;
+			/* __START_KERNEL_map addresses must be unmapped
+			 * because we map physical memory at __PAGE_OFFSET
+			 * and we don't want to keep aliases.
+			 */
+			kpte = lookup_address(addr, &l);
+			set_pte(kpte, __pte(0));
+		}
 	}
 #endif
 }
-- 
1.5.3.4



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/kernel.spec,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- kernel.spec	14 Apr 2008 16:50:37 -0000	1.36
+++ kernel.spec	15 Apr 2008 22:32:06 -0000	1.37
@@ -825,6 +825,7 @@
 Patch5152: linux-2.6-xen-0153-Don-t-use-FIX_VDSO-on-64-bit.patch
 Patch5153: linux-2.6-xen-0154-Mark-init-pages-read-write-again-on-free_init_pages.patch
 Patch5154: linux-2.6-xen-0155-reserve_early-kernel-text-and-data-segments.patch
+Patch5155: linux-2.6-xen-0156-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch
 # kernel-xen patches end
 
 # Xen hypervisor patches (20000+)
@@ -1522,6 +1523,7 @@
 ApplyPatch linux-2.6-xen-0153-Don-t-use-FIX_VDSO-on-64-bit.patch
 ApplyPatch linux-2.6-xen-0154-Mark-init-pages-read-write-again-on-free_init_pages.patch
 ApplyPatch linux-2.6-xen-0155-reserve_early-kernel-text-and-data-segments.patch
+ApplyPatch linux-2.6-xen-0156-Xen-Clear-__START_KERNEL_map-PTEs-on-free_init_page.patch
 %endif
 # kernel-xen apply end
 
@@ -2131,6 +2133,10 @@
 %kernel_variant_files -a /%{image_install_path}/xen*-%{KVERREL}.xen -e /etc/ld.so.conf.d/kernelcap-%{KVERREL}.xen.conf %{with_xen} xen
 
 %changelog
+* Tue Apr 15 2008 Eduardo Habkost <ehabkost at redhat.com>
+- Fix free_init_pages() to unmap pages from __START_KERNEL_map
+  (bug #441543)
+
 * Mon Apr 14 2008 Mark McLoughlin <markmc at redhat.com>
 - Rebase to kernel-2.6.25-0.228.rc9.fc9
 - Include Markus's latest console handling patch




More information about the fedora-extras-commits mailing list