diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/head64.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/init_64.c | 10 |
3 files changed, 11 insertions, 4 deletions
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 816fc85c9bb3..f3b19685918e 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c | |||
@@ -148,9 +148,6 @@ void __init x86_64_start_kernel(char * real_mode_data) | |||
148 | /* clear bss before set_intr_gate with early_idt_handler */ | 148 | /* clear bss before set_intr_gate with early_idt_handler */ |
149 | clear_bss(); | 149 | clear_bss(); |
150 | 150 | ||
151 | /* XXX - this is wrong... we need to build page tables from scratch */ | ||
152 | max_pfn_mapped = KERNEL_IMAGE_SIZE >> PAGE_SHIFT; | ||
153 | |||
154 | for (i = 0; i < NUM_EXCEPTION_VECTORS; i++) { | 151 | for (i = 0; i < NUM_EXCEPTION_VECTORS; i++) { |
155 | #ifdef CONFIG_EARLY_PRINTK | 152 | #ifdef CONFIG_EARLY_PRINTK |
156 | set_intr_gate(i, &early_idt_handlers[i]); | 153 | set_intr_gate(i, &early_idt_handlers[i]); |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index db9c41dae8d7..d58083a2e158 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -996,8 +996,10 @@ void __init setup_arch(char **cmdline_p) | |||
996 | setup_bios_corruption_check(); | 996 | setup_bios_corruption_check(); |
997 | #endif | 997 | #endif |
998 | 998 | ||
999 | #ifdef CONFIG_X86_32 | ||
999 | printk(KERN_DEBUG "initial memory mapped: [mem 0x00000000-%#010lx]\n", | 1000 | printk(KERN_DEBUG "initial memory mapped: [mem 0x00000000-%#010lx]\n", |
1000 | (max_pfn_mapped<<PAGE_SHIFT) - 1); | 1001 | (max_pfn_mapped<<PAGE_SHIFT) - 1); |
1002 | #endif | ||
1001 | 1003 | ||
1002 | reserve_real_mode(); | 1004 | reserve_real_mode(); |
1003 | 1005 | ||
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; |