]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - arch/powerpc/kernel/smp.c
[PATCH] powerpc: Add arch dependent basic infrastructure for Kdump.
[mirror_ubuntu-bionic-kernel.git] / arch / powerpc / kernel / smp.c
index a90df6bf0940be4fc67affbbb1482690c8da6d74..8e3ca674d359c39d3f82090e6506b676d39cf16b 100644 (file)
@@ -75,6 +75,8 @@ void smp_call_function_interrupt(void);
 
 int smt_enabled_at_boot = 1;
 
+static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL;
+
 #ifdef CONFIG_MPIC
 int __init smp_mpic_probe(void)
 {
@@ -123,11 +125,16 @@ void smp_message_recv(int msg, struct pt_regs *regs)
                /* XXX Do we have to do this? */
                set_need_resched();
                break;
-#ifdef CONFIG_DEBUGGER
        case PPC_MSG_DEBUGGER_BREAK:
+               if (crash_ipi_function_ptr) {
+                       crash_ipi_function_ptr(regs);
+                       break;
+               }
+#ifdef CONFIG_DEBUGGER
                debugger_ipi(regs);
                break;
-#endif
+#endif /* CONFIG_DEBUGGER */
+               /* FALLTHROUGH */
        default:
                printk("SMP %d: smp_message_recv(): unknown msg %d\n",
                       smp_processor_id(), msg);
@@ -147,6 +154,17 @@ void smp_send_debugger_break(int cpu)
 }
 #endif
 
+#ifdef CONFIG_KEXEC
+void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *))
+{
+       crash_ipi_function_ptr = crash_ipi_callback;
+       if (crash_ipi_callback) {
+               mb();
+               smp_ops->message_pass(MSG_ALL_BUT_SELF, PPC_MSG_DEBUGGER_BREAK);
+       }
+}
+#endif
+
 static void stop_this_cpu(void *dummy)
 {
        local_irq_disable();