Skip to content

Commit e06ca43

Browse files
heukelumIngo Molnar
authored andcommitted
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 <[email protected]> Acked-by: Neil Horman <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent e4955cf commit e06ca43

File tree

2 files changed

+13
-24
lines changed

2 files changed

+13
-24
lines changed

arch/x86/kernel/dumpstack_32.c

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -390,40 +390,29 @@ void die(const char *str, struct pt_regs *regs, long err)
390390
oops_end(flags, regs, sig);
391391
}
392392

393-
static DEFINE_SPINLOCK(nmi_print_lock);
394-
395393
void notrace __kprobes
396394
die_nmi(char *str, struct pt_regs *regs, int do_panic)
397395
{
396+
unsigned long flags;
397+
398398
if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP)
399399
return;
400400

401-
spin_lock(&nmi_print_lock);
402401
/*
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();
407406
printk(KERN_EMERG "%s", str);
408407
printk(" on CPU%d, ip %08lx, registers:\n",
409408
smp_processor_id(), regs->ip);
410409
show_registers(regs);
411-
if (do_panic)
410+
oops_end(flags, regs, 0);
411+
if (do_panic || panic_on_oops)
412412
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);
427416
}
428417

429418
static int __init oops_setup(char *s)

arch/x86/kernel/dumpstack_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,19 +519,19 @@ void die(const char *str, struct pt_regs *regs, long err)
519519
oops_end(flags, regs, sig);
520520
}
521521

522-
notrace __kprobes void
522+
void notrace __kprobes
523523
die_nmi(char *str, struct pt_regs *regs, int do_panic)
524524
{
525525
unsigned long flags;
526526

527527
if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP)
528528
return;
529529

530-
flags = oops_begin();
531530
/*
532531
* We are in trouble anyway, lets at least try
533532
* to get a message out.
534533
*/
534+
flags = oops_begin();
535535
printk(KERN_EMERG "%s", str);
536536
printk(" on CPU%d, ip %08lx, registers:\n",
537537
smp_processor_id(), regs->ip);

0 commit comments

Comments
 (0)