aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/dumpstack_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/dumpstack_32.c')
-rw-r--r--arch/x86/kernel/dumpstack_32.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index c398b27df6cd..dc9ca7ee1c47 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -403,6 +403,42 @@ void die(const char *str, struct pt_regs *regs, long err)
403 oops_end(flags, regs, SIGSEGV); 403 oops_end(flags, regs, SIGSEGV);
404} 404}
405 405
406static DEFINE_SPINLOCK(nmi_print_lock);
407
408void notrace __kprobes
409die_nmi(char *str, struct pt_regs *regs, int do_panic)
410{
411 if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP)
412 return;
413
414 spin_lock(&nmi_print_lock);
415 /*
416 * We are in trouble anyway, lets at least try
417 * to get a message out:
418 */
419 bust_spinlocks(1);
420 printk(KERN_EMERG "%s", str);
421 printk(" on CPU%d, ip %08lx, registers:\n",
422 smp_processor_id(), regs->ip);
423 show_registers(regs);
424 if (do_panic)
425 panic("Non maskable interrupt");
426 console_silent();
427 spin_unlock(&nmi_print_lock);
428 bust_spinlocks(0);
429
430 /*
431 * If we are in kernel we are probably nested up pretty bad
432 * and might aswell get out now while we still can:
433 */
434 if (!user_mode_vm(regs)) {
435 current->thread.trap_no = 2;
436 crash_kexec(regs);
437 }
438
439 do_exit(SIGSEGV);
440}
441
406static int __init kstack_setup(char *s) 442static int __init kstack_setup(char *s)
407{ 443{
408 kstack_depth_to_print = simple_strtoul(s, NULL, 0); 444 kstack_depth_to_print = simple_strtoul(s, NULL, 0);