sched: Fix unreleased llc_shared_mask bit during CPU hotplug
[pandora-kernel.git] / arch / x86 / kernel / smpboot.c
index 9f548cb..bb28f2c 100644 (file)
@@ -265,6 +265,13 @@ notrace static void __cpuinit start_secondary(void *unused)
         */
        check_tsc_sync_target();
 
+       /*
+        * Enable the espfix hack for this CPU
+        */
+#ifdef CONFIG_X86_ESPFIX64
+       init_espfix_ap();
+#endif
+
        /*
         * We need to hold call_lock, so there is no inconsistency
         * between the time smp_call_function() determines number of
@@ -1245,6 +1252,9 @@ static void remove_siblinginfo(int cpu)
 
        for_each_cpu(sibling, cpu_sibling_mask(cpu))
                cpumask_clear_cpu(cpu, cpu_sibling_mask(sibling));
+       for_each_cpu(sibling, cpu_llc_shared_mask(cpu))
+               cpumask_clear_cpu(cpu, cpu_llc_shared_mask(sibling));
+       cpumask_clear(cpu_llc_shared_mask(cpu));
        cpumask_clear(cpu_sibling_mask(cpu));
        cpumask_clear(cpu_core_mask(cpu));
        c->phys_proc_id = 0;
@@ -1278,6 +1288,7 @@ void cpu_disable_common(void)
 int native_cpu_disable(void)
 {
        int cpu = smp_processor_id();
+       int ret;
 
        /*
         * Perhaps use cpufreq to drop frequency, but that could go
@@ -1290,6 +1301,10 @@ int native_cpu_disable(void)
        if (cpu == 0)
                return -EBUSY;
 
+       ret = check_irq_vectors_for_cpu_disable();
+       if (ret)
+               return ret;
+
        clear_local_APIC();
 
        cpu_disable_common();