allow recursive die() on i386
From: Jeff Moyer
Date: Wed Jul 28 2004 - 07:38:57 EST
Hello,
This patch allows for a recursive die() on i386. This closely resembles
what is done on x86_64, fwiw.
-Jeff
--- linux-2.6.7/arch/i386/kernel/traps.c.orig 2004-07-28 08:08:21.000000000 -0400
+++ linux-2.6.7/arch/i386/kernel/traps.c 2004-07-28 08:10:54.000000000 -0400
@@ -294,6 +294,7 @@ bug:
}
spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
+static int die_owner = -1;
void die(const char * str, struct pt_regs * regs, long err)
{
@@ -301,7 +302,13 @@ void die(const char * str, struct pt_reg
int nl = 0;
console_verbose();
- spin_lock_irq(&die_lock);
+ local_irq_disable();
+ if (!spin_trylock(&die_lock)) {
+ if (smp_processor_id() != die_owner)
+ spin_lock(&die_lock);
+ /* allow recursive die to fall through */
+ }
+ die_owner = smp_processor_id();
bust_spinlocks(1);
handle_BUG(regs);
printk(KERN_ALERT "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter);
@@ -321,6 +328,7 @@ void die(const char * str, struct pt_reg
printk("\n");
show_registers(regs);
bust_spinlocks(0);
+ die_owner = -1;
spin_unlock_irq(&die_lock);
if (in_interrupt())
panic("Fatal exception in interrupt");
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/