diff options
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/init_64.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 9fbb85c8d930..dc67337d9bf0 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -378,10 +378,18 @@ void __init init_extra_mapping_uc(unsigned long phys, unsigned long size) | |||
378 | void __init cleanup_highmap(void) | 378 | void __init cleanup_highmap(void) |
379 | { | 379 | { |
380 | unsigned long vaddr = __START_KERNEL_map; | 380 | unsigned long vaddr = __START_KERNEL_map; |
381 | unsigned long vaddr_end = __START_KERNEL_map + (max_pfn_mapped << PAGE_SHIFT); | 381 | unsigned long vaddr_end = __START_KERNEL_map + KERNEL_IMAGE_SIZE; |
382 | unsigned long end = roundup((unsigned long)_brk_end, PMD_SIZE) - 1; | 382 | unsigned long end = roundup((unsigned long)_brk_end, PMD_SIZE) - 1; |
383 | pmd_t *pmd = level2_kernel_pgt; | 383 | pmd_t *pmd = level2_kernel_pgt; |
384 | 384 | ||
385 | /* | ||
386 | * Native path, max_pfn_mapped is not set yet. | ||
387 | * Xen has valid max_pfn_mapped set in | ||
388 | * arch/x86/xen/mmu.c:xen_setup_kernel_pagetable(). | ||
389 | */ | ||
390 | if (max_pfn_mapped) | ||
391 | vaddr_end = __START_KERNEL_map + (max_pfn_mapped << PAGE_SHIFT); | ||
392 | |||
385 | for (; vaddr + PMD_SIZE - 1 < vaddr_end; pmd++, vaddr += PMD_SIZE) { | 393 | for (; vaddr + PMD_SIZE - 1 < vaddr_end; pmd++, vaddr += PMD_SIZE) { |
386 | if (pmd_none(*pmd)) | 394 | if (pmd_none(*pmd)) |
387 | continue; | 395 | continue; |