From: kfraser@dhcp93.uk.xensource.com Date: Fri, 2 Jun 2006 17:06:50 +0000 (+0100) Subject: [LINUX][X86_64] Destroy initial page-table mappings to avoid overlap with modules. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15972^2~49^2~14 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=585c0a452871849b8a8d1e428b50983cf1c4692c;p=xen.git [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 --- diff --git a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c index 1de014d05b..9646f60598 100644 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c @@ -666,7 +666,18 @@ void __meminit init_memory_mapping(unsigned long start, unsigned long end) set_pgd(pgd_offset_k(start), mk_kernel_pgd(pud_phys)); } - BUG_ON(!after_bootmem && start_pfn != table_end); + if (!after_bootmem) { + BUG_ON(start_pfn != table_end); + /* + * 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_KERNEL_map + (table_end << PAGE_SHIFT); + for (; start < end; start += PAGE_SIZE) + WARN_ON(HYPERVISOR_update_va_mapping( + start, __pte_ma(0), 0)); + } __flush_tlb_all(); }