Commit 20c0d2d4 authored by Jan Beulich's avatar Jan Beulich Committed by Linus Torvalds

[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: default avatarJan Beulich <jbeulich@novell.com>
Acked-By: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 841b8a46
...@@ -386,8 +386,12 @@ void die(const char * str, struct pt_regs * regs, long err) ...@@ -386,8 +386,12 @@ void die(const char * str, struct pt_regs * regs, long err)
#endif #endif
if (nl) if (nl)
printk("\n"); printk("\n");
notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV); if (notify_die(DIE_OOPS, str, regs, err,
current->thread.trap_no, SIGSEGV) !=
NOTIFY_STOP)
show_registers(regs); show_registers(regs);
else
regs = NULL;
} else } else
printk(KERN_EMERG "Recursive die() failure, output suppressed\n"); printk(KERN_EMERG "Recursive die() failure, output suppressed\n");
...@@ -395,6 +399,9 @@ void die(const char * str, struct pt_regs * regs, long err) ...@@ -395,6 +399,9 @@ void die(const char * str, struct pt_regs * regs, long err)
die.lock_owner = -1; die.lock_owner = -1;
spin_unlock_irqrestore(&die.lock, flags); spin_unlock_irqrestore(&die.lock, flags);
if (!regs)
return;
if (kexec_should_crash(current)) if (kexec_should_crash(current))
crash_kexec(regs); crash_kexec(regs);
...@@ -623,7 +630,7 @@ static DEFINE_SPINLOCK(nmi_print_lock); ...@@ -623,7 +630,7 @@ static DEFINE_SPINLOCK(nmi_print_lock);
void die_nmi (struct pt_regs *regs, const char *msg) void die_nmi (struct pt_regs *regs, const char *msg)
{ {
if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 0, SIGINT) == if (notify_die(DIE_NMIWATCHDOG, msg, regs, 0, 2, SIGINT) ==
NOTIFY_STOP) NOTIFY_STOP)
return; return;
...@@ -662,7 +669,7 @@ static void default_do_nmi(struct pt_regs * regs) ...@@ -662,7 +669,7 @@ static void default_do_nmi(struct pt_regs * regs)
reason = get_nmi_reason(); reason = get_nmi_reason();
if (!(reason & 0xc0)) { if (!(reason & 0xc0)) {
if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT) if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 2, SIGINT)
== NOTIFY_STOP) == NOTIFY_STOP)
return; return;
#ifdef CONFIG_X86_LOCAL_APIC #ifdef CONFIG_X86_LOCAL_APIC
...@@ -678,7 +685,7 @@ static void default_do_nmi(struct pt_regs * regs) ...@@ -678,7 +685,7 @@ static void default_do_nmi(struct pt_regs * regs)
unknown_nmi_error(reason, regs); unknown_nmi_error(reason, regs);
return; return;
} }
if (notify_die(DIE_NMI, "nmi", regs, reason, 0, SIGINT) == NOTIFY_STOP) if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) == NOTIFY_STOP)
return; return;
if (reason & 0x80) if (reason & 0x80)
mem_parity_error(reason, regs); mem_parity_error(reason, regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment