diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-05-29 15:56:36 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-05-31 03:55:47 -0400 |
commit | f0d43100f13be0fa5bf52741d7084bb27f00e621 (patch) | |
tree | 768e44de5624e110c358ed0b5f5e6582ee2bbbea | |
parent | 3945e2c9abf8e00c2edc4aa29215ddfad1cd8cf7 (diff) |
x86: extend e820 early_res support 32bit -fix #3
introduce init_pg_table_start, so xen PV could specify the value.
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/head32.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/head_32.S | 2 | ||||
-rw-r--r-- | arch/x86/kernel/setup_32.c | 7 | ||||
-rw-r--r-- | arch/x86/lguest/boot.c | 5 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c | 3 | ||||
-rw-r--r-- | include/asm-x86/setup.h | 4 |
6 files changed, 19 insertions, 5 deletions
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c index c216d3c2a991..0b6cb9fba71e 100644 --- a/arch/x86/kernel/head32.c +++ b/arch/x86/kernel/head32.c | |||
@@ -76,7 +76,8 @@ void __init i386_start_kernel(void) | |||
76 | reserve_early(ramdisk_image, ramdisk_end, "RAMDISK"); | 76 | reserve_early(ramdisk_image, ramdisk_end, "RAMDISK"); |
77 | } | 77 | } |
78 | #endif | 78 | #endif |
79 | reserve_early(__pa_symbol(&_end), init_pg_tables_end, "INIT_PG_TABLE"); | 79 | reserve_early(init_pg_tables_start, init_pg_tables_end, |
80 | "INIT_PG_TABLE"); | ||
80 | 81 | ||
81 | reserve_ebda_region(); | 82 | reserve_ebda_region(); |
82 | 83 | ||
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index b2cc73768a9d..bef4618feadb 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
@@ -194,6 +194,7 @@ default_entry: | |||
194 | xorl %ebx,%ebx /* %ebx is kept at zero */ | 194 | xorl %ebx,%ebx /* %ebx is kept at zero */ |
195 | 195 | ||
196 | movl $pa(pg0), %edi | 196 | movl $pa(pg0), %edi |
197 | movl %edi, pa(init_pg_tables_start) | ||
197 | movl $pa(swapper_pg_pmd), %edx | 198 | movl $pa(swapper_pg_pmd), %edx |
198 | movl $PTE_ATTR, %eax | 199 | movl $PTE_ATTR, %eax |
199 | 10: | 200 | 10: |
@@ -228,6 +229,7 @@ default_entry: | |||
228 | page_pde_offset = (__PAGE_OFFSET >> 20); | 229 | page_pde_offset = (__PAGE_OFFSET >> 20); |
229 | 230 | ||
230 | movl $pa(pg0), %edi | 231 | movl $pa(pg0), %edi |
232 | movl %edi, pa(init_pg_tables_start) | ||
231 | movl $pa(swapper_pg_dir), %edx | 233 | movl $pa(swapper_pg_dir), %edx |
232 | movl $PTE_ATTR, %eax | 234 | movl $PTE_ATTR, %eax |
233 | 10: | 235 | 10: |
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c index 08b47a2f7af0..de9c5ee77d07 100644 --- a/arch/x86/kernel/setup_32.c +++ b/arch/x86/kernel/setup_32.c | |||
@@ -71,6 +71,7 @@ | |||
71 | /* This value is set up by the early boot code to point to the value | 71 | /* This value is set up by the early boot code to point to the value |
72 | immediately after the boot time page tables. It contains a *physical* | 72 | immediately after the boot time page tables. It contains a *physical* |
73 | address, and must not be in the .bss segment! */ | 73 | address, and must not be in the .bss segment! */ |
74 | unsigned long init_pg_tables_start __initdata = ~0UL; | ||
74 | unsigned long init_pg_tables_end __initdata = ~0UL; | 75 | unsigned long init_pg_tables_end __initdata = ~0UL; |
75 | 76 | ||
76 | /* | 77 | /* |
@@ -485,6 +486,10 @@ static void __init reserve_initrd(void) | |||
485 | return; | 486 | return; |
486 | } | 487 | } |
487 | 488 | ||
489 | printk(KERN_INFO "old RAMDISK: %08llx - %08llx\n", ramdisk_image, | ||
490 | ramdisk_end); | ||
491 | |||
492 | |||
488 | if (ramdisk_end <= end_of_lowmem) { | 493 | if (ramdisk_end <= end_of_lowmem) { |
489 | /* All in lowmem, easy case */ | 494 | /* All in lowmem, easy case */ |
490 | /* | 495 | /* |
@@ -511,6 +516,8 @@ static void __init reserve_initrd(void) | |||
511 | "NEW RAMDISK"); | 516 | "NEW RAMDISK"); |
512 | initrd_start = ramdisk_here + PAGE_OFFSET; | 517 | initrd_start = ramdisk_here + PAGE_OFFSET; |
513 | initrd_end = initrd_start + ramdisk_size; | 518 | initrd_end = initrd_start + ramdisk_size; |
519 | printk(KERN_INFO "Allocated new RAMDISK: %08llx - %08llx\n", | ||
520 | ramdisk_here, ramdisk_here + ramdisk_size); | ||
514 | 521 | ||
515 | do_relocate_initrd = true; | 522 | do_relocate_initrd = true; |
516 | } | 523 | } |
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index af65b2da3ba0..bf7c34a3aaeb 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -1011,6 +1011,7 @@ __init void lguest_init(void) | |||
1011 | * clobbered. The Launcher places our initial pagetables somewhere at | 1011 | * clobbered. The Launcher places our initial pagetables somewhere at |
1012 | * the top of our physical memory, so we don't need extra space: set | 1012 | * the top of our physical memory, so we don't need extra space: set |
1013 | * init_pg_tables_end to the end of the kernel. */ | 1013 | * init_pg_tables_end to the end of the kernel. */ |
1014 | init_pg_tables_start = __pa(pg0); | ||
1014 | init_pg_tables_end = __pa(pg0); | 1015 | init_pg_tables_end = __pa(pg0); |
1015 | 1016 | ||
1016 | /* Load the %fs segment register (the per-cpu segment register) with | 1017 | /* Load the %fs segment register (the per-cpu segment register) with |
@@ -1064,9 +1065,9 @@ __init void lguest_init(void) | |||
1064 | pm_power_off = lguest_power_off; | 1065 | pm_power_off = lguest_power_off; |
1065 | machine_ops.restart = lguest_restart; | 1066 | machine_ops.restart = lguest_restart; |
1066 | 1067 | ||
1067 | /* Now we're set up, call start_kernel() in init/main.c and we proceed | 1068 | /* Now we're set up, call i386_start_kernel() in head32.c and we proceed |
1068 | * to boot as normal. It never returns. */ | 1069 | * to boot as normal. It never returns. */ |
1069 | start_kernel(); | 1070 | i386_start_kernel(); |
1070 | } | 1071 | } |
1071 | /* | 1072 | /* |
1072 | * This marks the end of stage II of our journey, The Guest. | 1073 | * This marks the end of stage II of our journey, The Guest. |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index c8a56e457d61..ccc7b84ddabf 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1211,6 +1211,7 @@ asmlinkage void __init xen_start_kernel(void) | |||
1211 | 1211 | ||
1212 | pgd = (pgd_t *)xen_start_info->pt_base; | 1212 | pgd = (pgd_t *)xen_start_info->pt_base; |
1213 | 1213 | ||
1214 | init_pg_tables_start = __pa(pgd); | ||
1214 | init_pg_tables_end = __pa(pgd) + xen_start_info->nr_pt_frames*PAGE_SIZE; | 1215 | init_pg_tables_end = __pa(pgd) + xen_start_info->nr_pt_frames*PAGE_SIZE; |
1215 | 1216 | ||
1216 | init_mm.pgd = pgd; /* use the Xen pagetables to start */ | 1217 | init_mm.pgd = pgd; /* use the Xen pagetables to start */ |
@@ -1246,5 +1247,5 @@ asmlinkage void __init xen_start_kernel(void) | |||
1246 | add_preferred_console("hvc", 0, NULL); | 1247 | add_preferred_console("hvc", 0, NULL); |
1247 | 1248 | ||
1248 | /* Start the world */ | 1249 | /* Start the world */ |
1249 | start_kernel(); | 1250 | i386_start_kernel(); |
1250 | } | 1251 | } |
diff --git a/include/asm-x86/setup.h b/include/asm-x86/setup.h index ffa0f540fc7f..64f5f0c11d66 100644 --- a/include/asm-x86/setup.h +++ b/include/asm-x86/setup.h | |||
@@ -59,9 +59,11 @@ int __init copy_e820_map(struct e820entry *biosmap, int nr_map); | |||
59 | void __init add_memory_region(unsigned long long start, | 59 | void __init add_memory_region(unsigned long long start, |
60 | unsigned long long size, int type); | 60 | unsigned long long size, int type); |
61 | 61 | ||
62 | extern unsigned long init_pg_tables_end; | ||
63 | 62 | ||
63 | void __init i386_start_kernel(void); | ||
64 | 64 | ||
65 | extern unsigned long init_pg_tables_start; | ||
66 | extern unsigned long init_pg_tables_end; | ||
65 | 67 | ||
66 | #endif /* __i386__ */ | 68 | #endif /* __i386__ */ |
67 | #endif /* _SETUP */ | 69 | #endif /* _SETUP */ |