x86-64: Only set max_pfn_mapped to 512 MiB if we enter via head_64.S
Changes
2 files changed · +2 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| arch/x86/kernel/head64.c | modified | +2 | −0 | View file |
| arch/x86/kernel/setup.c | modified | +0 | −1 | View file |
arch/x86/kernel/head64.c
View filediff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 97adf98..2d2673c 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -80,6 +80,8 @@ void __init x86_64_start_kernel(char * real_mode_data)
/* Cleanup the over mapped high alias */
cleanup_highmap();
+ max_pfn_mapped = KERNEL_IMAGE_SIZE >> PAGE_SHIFT;
+
for (i = 0; i < NUM_EXCEPTION_VECTORS; i++) {
#ifdef CONFIG_EARLY_PRINTK
set_intr_gate(i, &early_idt_handlers[i]);
arch/x86/kernel/setup.c
View filediff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index b11a238..c3cebfe 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -932,7 +932,6 @@ void __init setup_arch(char **cmdline_p)
max_low_pfn = max_pfn;
high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1;
- max_pfn_mapped = KERNEL_IMAGE_SIZE >> PAGE_SHIFT;
#endif
/*