From: Dave Kleikamp Date: Thu, 4 Feb 2016 16:43:48 +0000 (-0600) Subject: sparc64: call crash_kexec() directly from die_if_kernel() X-Git-Tag: v4.1.12-92~147^2~3^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=954537138cf7b2ba7a55ad8f2b68fd00751b3ef1;p=users%2Fjedix%2Flinux-maple.git sparc64: call crash_kexec() directly from die_if_kernel() 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 --- diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index d21cd625c0ded..6202f71767f5e 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -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)