x86/smp: Don't ever patch back to UP if we unplug cpus
[pandora-kernel.git] / arch / x86 / xen / smp.c
index 9a23fff..a8991d4 100644 (file)
@@ -368,7 +368,8 @@ static int __cpuinit xen_cpu_up(unsigned int cpu)
                return rc;
 
        if (num_online_cpus() == 1)
-               alternatives_smp_switch(1);
+               /* Just in case we booted with a single CPU. */
+               alternatives_enable_smp();
 
        rc = xen_smp_intr_init(cpu);
        if (rc)
@@ -414,9 +415,6 @@ static void xen_cpu_die(unsigned int cpu)
        unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu), NULL);
        xen_uninit_lock_cpu(cpu);
        xen_teardown_timer(cpu);
-
-       if (num_online_cpus() == 1)
-               alternatives_smp_switch(0);
 }
 
 static void __cpuinit xen_play_dead(void) /* used only with HOTPLUG_CPU */
@@ -563,6 +561,8 @@ static void xen_hvm_cpu_die(unsigned int cpu)
        unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu), NULL);
        unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu), NULL);
        unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu), NULL);
+       xen_uninit_lock_cpu(cpu);
+       xen_teardown_timer(cpu);
        native_cpu_die(cpu);
 }