aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/smpboot.c
diff options
context:
space:
mode:
authorBorislav Petkov <bp@alien8.de>2010-08-28 09:58:33 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2010-10-20 17:23:55 -0400
commitb40827fa7268fda8a62490728a61c2856f33830b (patch)
treeae16ce8206c3d72ca672a92a46dc0725faba1ced /arch/x86/kernel/smpboot.c
parentd25e6b0b326278a1096e8334584c3e64517057a3 (diff)
x86-32, mm: Add an initial page table for core bootstrapping
This patch adds an initial page table with low mappings used exclusively for booting APs/resuming after ACPI suspend/machine restart. After this, there's no need to add low mappings to swapper_pg_dir and zap them later or create own swsusp PGD page solely for ACPI sleep needs - we have initial_page_table for that. Signed-off-by: Borislav Petkov <bp@alien8.de> LKML-Reference: <20101020070526.GA9588@liondog.tnic> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r--arch/x86/kernel/smpboot.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 63a1a5596ac0..e63bb5185855 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -298,22 +298,16 @@ notrace static void __cpuinit start_secondary(void *unused)
298 * fragile that we want to limit the things done here to the 298 * fragile that we want to limit the things done here to the
299 * most necessary things. 299 * most necessary things.
300 */ 300 */
301 cpu_init();
302 preempt_disable();
303 smp_callin();
301 304
302#ifdef CONFIG_X86_32 305#ifdef CONFIG_X86_32
303 /* 306 /* switch away from the initial page table */
304 * Switch away from the trampoline page-table
305 *
306 * Do this before cpu_init() because it needs to access per-cpu
307 * data which may not be mapped in the trampoline page-table.
308 */
309 load_cr3(swapper_pg_dir); 307 load_cr3(swapper_pg_dir);
310 __flush_tlb_all(); 308 __flush_tlb_all();
311#endif 309#endif
312 310
313 cpu_init();
314 preempt_disable();
315 smp_callin();
316
317 /* otherwise gcc will move up smp_processor_id before the cpu_init */ 311 /* otherwise gcc will move up smp_processor_id before the cpu_init */
318 barrier(); 312 barrier();
319 /* 313 /*
@@ -772,7 +766,6 @@ do_rest:
772#ifdef CONFIG_X86_32 766#ifdef CONFIG_X86_32
773 /* Stack for startup_32 can be just as for start_secondary onwards */ 767 /* Stack for startup_32 can be just as for start_secondary onwards */
774 irq_ctx_init(cpu); 768 irq_ctx_init(cpu);
775 initial_page_table = __pa(&trampoline_pg_dir);
776#else 769#else
777 clear_tsk_thread_flag(c_idle.idle, TIF_FORK); 770 clear_tsk_thread_flag(c_idle.idle, TIF_FORK);
778 initial_gs = per_cpu_offset(cpu); 771 initial_gs = per_cpu_offset(cpu);
@@ -921,7 +914,6 @@ int __cpuinit native_cpu_up(unsigned int cpu)
921 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; 914 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
922 915
923 err = do_boot_cpu(apicid, cpu); 916 err = do_boot_cpu(apicid, cpu);
924
925 if (err) { 917 if (err) {
926 pr_debug("do_boot_cpu failed %d\n", err); 918 pr_debug("do_boot_cpu failed %d\n", err);
927 return -EIO; 919 return -EIO;