[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.0-testing] [LINUX][X86_64] Destroy initial page-table mappings to avoid overlap with modules.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID db51d90a9bfefd5c43e315105fb5e1acfbaaf04a
# Parent  1198f4eb43d10af04adbaaab52bfa55b6f48e9b6
[LINUX][X86_64] Destroy initial page-table mappings to avoid overlap with 
modules.

The temporary mappings needed to set up the 1:1 mappings must be torn
down after use; otherwise they may trigger the
WARN_ON() in vmap_pte_range() (namely if the chunk allocated to hold
kernel and initial page tables gets close to or
exceeds 128Mb, or if a sufficiently high mem= argument causes the
static allocations to grow beyond 128Mb, which in
either case means these mappings extend into the modules area).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
xen-unstable changeset:   10264:40331b1545d2de761b3d4d2777ff9349eceb5c1a
xen-unstable date:        Fri Jun 02 18:06:50 2006 +0100
---
 linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletion(-)

diff -r 1198f4eb43d1 -r db51d90a9bfe 
linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c    Fri Jun 02 13:37:07 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c    Fri Jun 02 18:09:58 
2006 +0100
@@ -660,7 +660,18 @@ void __meminit init_memory_mapping(unsig
                        set_pgd(pgd_offset_k(start), mk_kernel_pgd(pud_phys));
        }
 
-       BUG_ON(!after_bootmem && start_pfn != table_start + (tables_space >> 
PAGE_SHIFT));
+       if (!after_bootmem) {
+               BUG_ON(start_pfn != table_start + (tables_space >> PAGE_SHIFT));
+               /*
+                * Destroy the temporary mappings created above. Prevents
+                * overlap with modules area (if init mapping is very big).
+                */
+               start = __START_KERNEL_map + (table_start << PAGE_SHIFT);
+               end   = start + tables_space;
+               for (; start < end; start += PAGE_SIZE)
+                       WARN_ON(HYPERVISOR_update_va_mapping(
+                               start, __pte_ma(0), 0));
+       }
 
        __flush_tlb_all();
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.