提交 0ed7a498 编写于 作者: A Alexander van Heukelum 提交者: Ingo Molnar

x86_64, dumpstack: move kexec_crash from __die to oops_end

oops_end is preceded by either a call to __die, or a conditional
call to crash_kexec. Move the conditional call to crash_kexec
from the end of __die to the start of oops_end and remove
the superfluous call to crash_kexec in die_nmi.
Signed-off-by: NAlexander van Heukelum <heukelum@fastmail.fm>
Acked-by: NNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 874d93d1
...@@ -458,6 +458,9 @@ unsigned __kprobes long oops_begin(void) ...@@ -458,6 +458,9 @@ unsigned __kprobes long oops_begin(void)
void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr) void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
{ {
if (regs && kexec_should_crash(current))
crash_kexec(regs);
die_owner = -1; die_owner = -1;
bust_spinlocks(0); bust_spinlocks(0);
die_nest_count--; die_nest_count--;
...@@ -501,8 +504,6 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err) ...@@ -501,8 +504,6 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
printk(KERN_ALERT "RIP "); printk(KERN_ALERT "RIP ");
printk_address(regs->ip, 1); printk_address(regs->ip, 1);
printk(" RSP <%016lx>\n", regs->sp); printk(" RSP <%016lx>\n", regs->sp);
if (kexec_should_crash(current))
crash_kexec(regs);
return 0; return 0;
} }
...@@ -536,11 +537,9 @@ die_nmi(char *str, struct pt_regs *regs, int do_panic) ...@@ -536,11 +537,9 @@ die_nmi(char *str, struct pt_regs *regs, int do_panic)
printk(" on CPU%d, ip %08lx, registers:\n", printk(" on CPU%d, ip %08lx, registers:\n",
smp_processor_id(), regs->ip); smp_processor_id(), regs->ip);
show_registers(regs); show_registers(regs);
if (kexec_should_crash(current)) oops_end(flags, regs, 0);
crash_kexec(regs);
if (do_panic || panic_on_oops) if (do_panic || panic_on_oops)
panic("Non maskable interrupt"); panic("Non maskable interrupt");
oops_end(flags, regs, 0);
nmi_exit(); nmi_exit();
local_irq_enable(); local_irq_enable();
do_exit(SIGBUS); do_exit(SIGBUS);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册