aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2006-03-26 04:37:01 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:56:53 -0500
commit20c0d2d4402973050e7aad8a481ec6f847ee40d8 (patch)
treea3fc29f54187aa9d2dad25a018011443ca83d7ff
parent841b8a46bffec232377d2de157f971e812be4fe4 (diff)
[PATCH] i386: pass proper trap numbers to die chain handlers
Pass the trap number causing the call to notify_die() to the die notification handler chain in a number of instances. Also, honor the return value from the handler chain invocation in die() as, through a debugger, the fault may have been fixed. Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-By: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/i386/kernel/traps.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index de5386b01d38..4624f8ca2459 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -386,8 +386,12 @@ void die(const char * str, struct pt_regs * regs, long err)
386#endif 386#endif
387 if (nl) 387 if (nl)
388 printk("\n"); 388 printk("\n");
389 notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV); 389 if (notify_die(DIE_OOPS, str, regs, err,
390 show_registers(regs); 390 current->thread.trap_no, SIGSEGV) !=
391 NOTIFY_STOP)
392 show_registers(regs);
393 else
394 regs = NULL;
391 } else 395 } else
392 printk(KERN_EMERG "Recursive die() failure, output suppressed\n"); 396 printk(KERN_EMERG "Recursive die() failure, output suppressed\n");
393 397
@@ -395,6 +399,9 @@ void die(const char * str, struct pt_regs * regs, long err)
395 die.lock_owner = -1; 399 die.lock_owner = -1;
396 spin_unlock_irqrestore(&die.lock, flags); 400 spin_unlock_irqrestore(&die.lock, flags);
397 401
402 if (!regs)
403 return;
404
398 if (kexec_should_crash(current)) 405 if (kexec_should_crash(current))
399 crash_kexec(regs); 406 crash_kexec(regs);
400 407
@@ -623,7 +630,7 @@ static DEFINE_SPINLOCK(nmi_print_lock);
623 630
624void die_nmi (struct pt_regs *regs, const char *msg) 631void die_nmi (struct pt_regs *regs, const char *msg)
625{ 632{
626 if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 0, SIGINT) == 633 if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 2, SIGINT) ==
627 NOTIFY_STOP) 634 NOTIFY_STOP)
628 return; 635 return;
629 636
@@ -662,7 +669,7 @@ static void default_do_nmi(struct pt_regs * regs)
662 reason = get_nmi_reason(); 669 reason = get_nmi_reason();
663 670
664 if (!(reason & 0xc0)) { 671 if (!(reason & 0xc0)) {
665 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) 672 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 2, SIGINT)
666 == NOTIFY_STOP) 673 == NOTIFY_STOP)
667 return; 674 return;
668#ifdef CONFIG_X86_LOCAL_APIC 675#ifdef CONFIG_X86_LOCAL_APIC
@@ -678,7 +685,7 @@ static void default_do_nmi(struct pt_regs * regs)
678 unknown_nmi_error(reason, regs); 685 unknown_nmi_error(reason, regs);
679 return; 686 return;
680 } 687 }
681 if (notify_die(DIE_NMI, "nmi", regs, reason, 0, SIGINT) == NOTIFY_STOP) 688 if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP)
682 return; 689 return;
683 if (reason & 0x80) 690 if (reason & 0x80)
684 mem_parity_error(reason, regs); 691 mem_parity_error(reason, regs);