aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/dumpstack_32.c33
-rw-r--r--arch/x86/kernel/dumpstack_64.c4
2 files changed, 13 insertions, 24 deletions
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index 7c7d691b32be..e91ae34f9684 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -390,40 +390,29 @@ void die(const char *str, struct pt_regs *regs, long err)
390 oops_end(flags, regs, sig); 390 oops_end(flags, regs, sig);
391} 391}
392 392
393static DEFINE_SPINLOCK(nmi_print_lock);
394
395void notrace __kprobes 393void notrace __kprobes
396die_nmi(char *str, struct pt_regs *regs, int do_panic) 394die_nmi(char *str, struct pt_regs *regs, int do_panic)
397{ 395{
396 unsigned long flags;
397
398 if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP) 398 if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP)
399 return; 399 return;
400 400
401 spin_lock(&nmi_print_lock);
402 /* 401 /*
403 * We are in trouble anyway, lets at least try 402 * We are in trouble anyway, lets at least try
404 * to get a message out: 403 * to get a message out.
405 */ 404 */
406 bust_spinlocks(1); 405 flags = oops_begin();
407 printk(KERN_EMERG "%s", str); 406 printk(KERN_EMERG "%s", str);
408 printk(" on CPU%d, ip %08lx, registers:\n", 407 printk(" on CPU%d, ip %08lx, registers:\n",
409 smp_processor_id(), regs->ip); 408 smp_processor_id(), regs->ip);
410 show_registers(regs); 409 show_registers(regs);
411 if (do_panic) 410 oops_end(flags, regs, 0);
411 if (do_panic || panic_on_oops)
412 panic("Non maskable interrupt"); 412 panic("Non maskable interrupt");
413 console_silent(); 413 nmi_exit();
414 spin_unlock(&nmi_print_lock); 414 local_irq_enable();
415 415 do_exit(SIGBUS);
416 /*
417 * If we are in kernel we are probably nested up pretty bad
418 * and might aswell get out now while we still can:
419 */
420 if (!user_mode_vm(regs)) {
421 current->thread.trap_no = 2;
422 crash_kexec(regs);
423 }
424
425 bust_spinlocks(0);
426 do_exit(SIGSEGV);
427} 416}
428 417
429static int __init oops_setup(char *s) 418static int __init oops_setup(char *s)
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index dc6162bf7454..831e1e159cb4 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -519,7 +519,7 @@ void die(const char *str, struct pt_regs *regs, long err)
519 oops_end(flags, regs, sig); 519 oops_end(flags, regs, sig);
520} 520}
521 521
522notrace __kprobes void 522void notrace __kprobes
523die_nmi(char *str, struct pt_regs *regs, int do_panic) 523die_nmi(char *str, struct pt_regs *regs, int do_panic)
524{ 524{
525 unsigned long flags; 525 unsigned long flags;
@@ -527,11 +527,11 @@ die_nmi(char *str, struct pt_regs *regs, int do_panic)
527 if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP) 527 if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP)
528 return; 528 return;
529 529
530 flags = oops_begin();
531 /* 530 /*
532 * We are in trouble anyway, lets at least try 531 * We are in trouble anyway, lets at least try
533 * to get a message out. 532 * to get a message out.
534 */ 533 */
534 flags = oops_begin();
535 printk(KERN_EMERG "%s", str); 535 printk(KERN_EMERG "%s", str);
536 printk(" on CPU%d, ip %08lx, registers:\n", 536 printk(" on CPU%d, ip %08lx, registers:\n",
537 smp_processor_id(), regs->ip); 537 smp_processor_id(), regs->ip);