From: Li Shaohua It's a bit awkward to be calling things by hand on SMP and with an initcall on UP. Maybe something neater can be done there. Signed-off-by: Andrew Morton --- arch/i386/kernel/cpu/common.c | 3 +++ arch/i386/kernel/smpboot.c | 5 ----- arch/i386/kernel/sysenter.c | 10 ---------- arch/i386/mach-voyager/voyager_smp.c | 4 ---- include/asm-i386/processor.h | 1 + include/asm-i386/smp.h | 2 -- 6 files changed, 4 insertions(+), 21 deletions(-) diff -puN arch/i386/kernel/cpu/common.c~sep-initializing-rework-cleanup arch/i386/kernel/cpu/common.c --- 25/arch/i386/kernel/cpu/common.c~sep-initializing-rework-cleanup Mon May 9 16:28:56 2005 +++ 25-akpm/arch/i386/kernel/cpu/common.c Mon May 9 16:28:56 2005 @@ -428,6 +428,9 @@ void __init identify_cpu(struct cpuinfo_ #ifdef CONFIG_X86_MCE machine_check_init(c); #endif + if (c == &boot_cpu_data) + sysenter_setup(); + enable_sep_cpu(); } #ifdef CONFIG_X86_HT diff -puN arch/i386/kernel/smpboot.c~sep-initializing-rework-cleanup arch/i386/kernel/smpboot.c --- 25/arch/i386/kernel/smpboot.c~sep-initializing-rework-cleanup Mon May 9 16:28:56 2005 +++ 25-akpm/arch/i386/kernel/smpboot.c Mon May 9 16:30:32 2005 @@ -444,8 +444,6 @@ static void __init start_secondary(void */ local_flush_tlb(); - /* Note: this must be done before __cpu_up finish */ - enable_sep_cpu(); cpu_set(smp_processor_id(), cpu_online_map); /* We can take interrupts now: we're officially "up". */ @@ -923,9 +921,6 @@ static void __init smp_boot_cpus(unsigne cpus_clear(cpu_core_map[0]); cpu_set(0, cpu_core_map[0]); - sysenter_setup(); - enable_sep_cpu(); - /* * If we couldn't find an SMP configuration at boot time, * get out of here now! diff -puN arch/i386/kernel/sysenter.c~sep-initializing-rework-cleanup arch/i386/kernel/sysenter.c --- 25/arch/i386/kernel/sysenter.c~sep-initializing-rework-cleanup Mon May 9 16:28:56 2005 +++ 25-akpm/arch/i386/kernel/sysenter.c Mon May 9 16:28:56 2005 @@ -65,13 +65,3 @@ int __init sysenter_setup(void) return 0; } - -#ifndef CONFIG_SMP -static int __init sysenter_sep_setup(void) -{ - sysenter_setup(); - enable_sep_cpu(); - return 0; -} -module_init(sysenter_sep_setup); -#endif diff -puN arch/i386/mach-voyager/voyager_smp.c~sep-initializing-rework-cleanup arch/i386/mach-voyager/voyager_smp.c --- 25/arch/i386/mach-voyager/voyager_smp.c~sep-initializing-rework-cleanup Mon May 9 16:28:56 2005 +++ 25-akpm/arch/i386/mach-voyager/voyager_smp.c Mon May 9 16:28:56 2005 @@ -499,7 +499,6 @@ start_secondary(void *unused) while (!cpu_isset(cpuid, smp_commenced_mask)) rep_nop(); local_irq_enable(); - enable_sep_cpu(); local_flush_tlb(); @@ -697,9 +696,6 @@ smp_boot_cpus(void) printk("CPU%d: ", boot_cpu_id); print_cpu_info(&cpu_data[boot_cpu_id]); - sysenter_setup(); - enable_sep_cpu(); - if(is_cpu_quad()) { /* booting on a Quad CPU */ printk("VOYAGER SMP: Boot CPU is Quad\n"); diff -puN include/asm-i386/processor.h~sep-initializing-rework-cleanup include/asm-i386/processor.h --- 25/include/asm-i386/processor.h~sep-initializing-rework-cleanup Mon May 9 16:28:56 2005 +++ 25-akpm/include/asm-i386/processor.h Mon May 9 16:28:56 2005 @@ -692,5 +692,6 @@ extern void select_idle_routine(const st extern unsigned long boot_option_idle_override; extern void enable_sep_cpu(void); +extern int sysenter_setup(void); #endif /* __ASM_I386_PROCESSOR_H */ diff -puN include/asm-i386/smp.h~sep-initializing-rework-cleanup include/asm-i386/smp.h --- 25/include/asm-i386/smp.h~sep-initializing-rework-cleanup Mon May 9 16:28:56 2005 +++ 25-akpm/include/asm-i386/smp.h Mon May 9 16:28:56 2005 @@ -37,8 +37,6 @@ extern int smp_num_siblings; extern cpumask_t cpu_sibling_map[]; extern cpumask_t cpu_core_map[]; -extern int sysenter_setup(void); - extern void smp_flush_tlb(void); extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs); extern void smp_invalidate_rcv(void); /* Process an NMI */ _