Merge branch 'akpm' (patches from Andrew)
[cascardo/linux.git] / arch / x86 / kernel / crash.c
index 9616cf7..650830e 100644 (file)
@@ -133,15 +133,31 @@ static void kdump_nmi_callback(int cpu, struct pt_regs *regs)
        disable_local_APIC();
 }
 
-static void kdump_nmi_shootdown_cpus(void)
+void kdump_nmi_shootdown_cpus(void)
 {
        nmi_shootdown_cpus(kdump_nmi_callback);
 
        disable_local_APIC();
 }
 
+/* Override the weak function in kernel/panic.c */
+void crash_smp_send_stop(void)
+{
+       static int cpus_stopped;
+
+       if (cpus_stopped)
+               return;
+
+       if (smp_ops.crash_stop_other_cpus)
+               smp_ops.crash_stop_other_cpus();
+       else
+               smp_send_stop();
+
+       cpus_stopped = 1;
+}
+
 #else
-static void kdump_nmi_shootdown_cpus(void)
+void crash_smp_send_stop(void)
 {
        /* There are no cpus to shootdown */
 }
@@ -160,7 +176,7 @@ void native_machine_crash_shutdown(struct pt_regs *regs)
        /* The kernel is broken so disable interrupts */
        local_irq_disable();
 
-       kdump_nmi_shootdown_cpus();
+       crash_smp_send_stop();
 
        /*
         * VMCLEAR VMCSs loaded on this cpu if needed.