All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i386: don't blindly enable interrupts in die()
@ 2005-11-08 12:55 Jan Beulich
  2005-11-08 22:57 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2005-11-08 12:55 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

Rather than blindly re-enabling interrupts in die(), save their state
upon entry and then restore that state.

From: Jan Beulich <jbeulich@novell.com>

(actual patch attached)


[-- Attachment #2: linux-2.6.14-i386-die-irq.patch --]
[-- Type: application/octet-stream, Size: 1017 bytes --]

Rather than blindly re-enabling interrupts in die(), save their state
upon entry and then restore that state.

From: Jan Beulich <jbeulich@novell.com>

--- 2.6.14/arch/i386/kernel/traps.c	2005-10-28 02:02:08.000000000 +0200
+++ 2.6.14-i386-die-irq/arch/i386/kernel/traps.c	2005-11-04 17:00:47.000000000 +0100
@@ -306,14 +306,17 @@ void die(const char * str, struct pt_reg
 		.lock_owner_depth =	0
 	};
 	static int die_counter;
+	unsigned long flags;
 
 	if (die.lock_owner != raw_smp_processor_id()) {
 		console_verbose();
-		spin_lock_irq(&die.lock);
+		spin_lock_irqsave(&die.lock, flags);
 		die.lock_owner = smp_processor_id();
 		die.lock_owner_depth = 0;
 		bust_spinlocks(1);
 	}
+	else
+		local_save_flags(flags);
 
 	if (++die.lock_owner_depth < 3) {
 		int nl = 0;
@@ -340,7 +343,7 @@ void die(const char * str, struct pt_reg
 
 	bust_spinlocks(0);
 	die.lock_owner = -1;
-	spin_unlock_irq(&die.lock);
+	spin_unlock_irqrestore(&die.lock, flags);
 
 	if (kexec_should_crash(current))
 		crash_kexec(regs);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-11-09  8:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-08 12:55 [PATCH] i386: don't blindly enable interrupts in die() Jan Beulich
2005-11-08 22:57 ` Andrew Morton
2005-11-09  8:06   ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.