Commit e06ca430c3d0fddbd1c901ab3fb3e1f0bc8a786b

Authored by Alexander van Heukelum
Committed by Ingo Molnar
1 parent e4955cfd2f

i386, dumpstack: use oops_begin/oops_end in die_nmi

Use oops_begin and oops_end in die_nmi.

Whitespace-only changes on x86_64, to make it equal to i386's
version.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 2 changed files with 13 additions and 24 deletions Side-by-side Diff

arch/x86/kernel/dumpstack_32.c
... ... @@ -390,40 +390,29 @@
390 390 oops_end(flags, regs, sig);
391 391 }
392 392  
393   -static DEFINE_SPINLOCK(nmi_print_lock);
394   -
395 393 void notrace __kprobes
396 394 die_nmi(char *str, struct pt_regs *regs, int do_panic)
397 395 {
  396 + unsigned long flags;
  397 +
398 398 if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP)
399 399 return;
400 400  
401   - spin_lock(&nmi_print_lock);
402 401 /*
403   - * We are in trouble anyway, lets at least try
404   - * to get a message out:
405   - */
406   - bust_spinlocks(1);
  402 + * We are in trouble anyway, lets at least try
  403 + * to get a message out.
  404 + */
  405 + flags = oops_begin();
407 406 printk(KERN_EMERG "%s", str);
408 407 printk(" on CPU%d, ip %08lx, registers:\n",
409 408 smp_processor_id(), regs->ip);
410 409 show_registers(regs);
411   - if (do_panic)
  410 + oops_end(flags, regs, 0);
  411 + if (do_panic || panic_on_oops)
412 412 panic("Non maskable interrupt");
413   - console_silent();
414   - spin_unlock(&nmi_print_lock);
415   -
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);
  413 + nmi_exit();
  414 + local_irq_enable();
  415 + do_exit(SIGBUS);
427 416 }
428 417  
429 418 static int __init oops_setup(char *s)
arch/x86/kernel/dumpstack_64.c
... ... @@ -519,7 +519,7 @@
519 519 oops_end(flags, regs, sig);
520 520 }
521 521  
522   -notrace __kprobes void
  522 +void notrace __kprobes
523 523 die_nmi(char *str, struct pt_regs *regs, int do_panic)
524 524 {
525 525 unsigned long flags;
526 526  
... ... @@ -527,11 +527,11 @@
527 527 if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP)
528 528 return;
529 529  
530   - flags = oops_begin();
531 530 /*
532 531 * We are in trouble anyway, lets at least try
533 532 * to get a message out.
534 533 */
  534 + flags = oops_begin();
535 535 printk(KERN_EMERG "%s", str);
536 536 printk(" on CPU%d, ip %08lx, registers:\n",
537 537 smp_processor_id(), regs->ip);