ia64/xen-unstable

changeset 10302:40331b1545d2

[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@novell.com>
author kfraser@dhcp93.uk.xensource.com
date Fri Jun 02 18:06:50 2006 +0100 (2006-06-02)
parents a3733a587a9c
children c9e6255cb44a
files linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Fri Jun 02 17:54:55 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Fri Jun 02 18:06:50 2006 +0100
     1.3 @@ -666,7 +666,18 @@ void __meminit init_memory_mapping(unsig
     1.4  			set_pgd(pgd_offset_k(start), mk_kernel_pgd(pud_phys));
     1.5  	}
     1.6  
     1.7 -	BUG_ON(!after_bootmem && start_pfn != table_end);
     1.8 +	if (!after_bootmem) {
     1.9 +		BUG_ON(start_pfn != table_end);
    1.10 +		/*
    1.11 +		 * Destroy the temporary mappings created above. Prevents
    1.12 +		 * overlap with modules area (if init mapping is very big).
    1.13 +		 */
    1.14 +		start = __START_KERNEL_map + (table_start << PAGE_SHIFT);
    1.15 +		end   = __START_KERNEL_map + (table_end   << PAGE_SHIFT);
    1.16 +		for (; start < end; start += PAGE_SIZE)
    1.17 +			WARN_ON(HYPERVISOR_update_va_mapping(
    1.18 +				start, __pte_ma(0), 0));
    1.19 +	}
    1.20  
    1.21  	__flush_tlb_all();
    1.22  }