aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@fastmail.fm>2008-10-04 17:12:40 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-13 04:33:39 -0400
commitdd6e4eba1c03c9562fced21736453396c045f869 (patch)
treee9251e3616b96ff783b1ca88e274fadebf420d6c
parent8728861b4fead8119a1b7bb856a387320859cd98 (diff)
dumpstack: x86: move die_nmi to dumpstack_32.c
For some reason die_nmi is still defined in traps.c for i386, but is found in dumpstack_64.c for x86_64. Move it to dumpstack_32.c Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/dumpstack_32.c36
-rw-r--r--arch/x86/kernel/traps.c37
2 files changed, 36 insertions, 37 deletions
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index c398b27df6c..dc9ca7ee1c4 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);
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index ffb131f74f7..e062974cce3 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -429,43 +429,6 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
429 printk(KERN_EMERG "Dazed and confused, but trying to continue\n"); 429 printk(KERN_EMERG "Dazed and confused, but trying to continue\n");
430} 430}
431 431
432#ifdef CONFIG_X86_32
433static DEFINE_SPINLOCK(nmi_print_lock);
434
435void notrace __kprobes die_nmi(char *str, struct pt_regs *regs, int do_panic)
436{
437 if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP)
438 return;
439
440 spin_lock(&nmi_print_lock);
441 /*
442 * We are in trouble anyway, lets at least try
443 * to get a message out:
444 */
445 bust_spinlocks(1);
446 printk(KERN_EMERG "%s", str);
447 printk(" on CPU%d, ip %08lx, registers:\n",
448 smp_processor_id(), regs->ip);
449 show_registers(regs);
450 if (do_panic)
451 panic("Non maskable interrupt");
452 console_silent();
453 spin_unlock(&nmi_print_lock);
454 bust_spinlocks(0);
455
456 /*
457 * If we are in kernel we are probably nested up pretty bad
458 * and might aswell get out now while we still can:
459 */
460 if (!user_mode_vm(regs)) {
461 current->thread.trap_no = 2;
462 crash_kexec(regs);
463 }
464
465 do_exit(SIGSEGV);
466}
467#endif
468
469static notrace __kprobes void default_do_nmi(struct pt_regs *regs) 432static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
470{ 433{
471 unsigned char reason = 0; 434 unsigned char reason = 0;