]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: call crash_kexec() directly from die_if_kernel()
authorDave Kleikamp <dave.kleikamp@oracle.com>
Thu, 4 Feb 2016 16:43:48 +0000 (10:43 -0600)
committerDave Kleikamp <dave.kleikamp@oracle.com>
Mon, 18 Apr 2016 16:42:51 +0000 (11:42 -0500)
A direct call to crash_kexec() here allows the crashing register state
to be saved to the PT_NOTE. When called from panic(), a new register
state is created which is less useful.

Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
arch/sparc/kernel/traps_64.c

index d21cd625c0dedda934ec4ebde5a6aed8015a7415..6202f71767f5ec43277c784b38fb376e0b2590cc 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/reboot.h>
 #include <linux/gfp.h>
 #include <linux/context_tracking.h>
+#include <linux/kexec.h>
 
 #include <asm/smp.h>
 #include <asm/delay.h>
@@ -2386,6 +2387,8 @@ static inline struct reg_window *kernel_stack_up(struct reg_window *rw)
        return (struct reg_window *) (fp + STACK_BIAS);
 }
 
+static int crashing_cpu;
+
 void __noreturn die_if_kernel(char *str, struct pt_regs *regs)
 {
        static int die_counter;
@@ -2427,6 +2430,8 @@ void __noreturn die_if_kernel(char *str, struct pt_regs *regs)
                }
                user_instruction_dump ((unsigned int __user *) regs->tpc);
        }
+       crashing_cpu = smp_processor_id();
+       crash_kexec(regs);
        if (panic_on_oops)
                panic("Fatal exception");
        if (regs->tstate & TSTATE_PRIV)