All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@novell.com>
To: <linux-kernel@vger.kernel.org>
Subject: [PATCH] i386: don't blindly enable interrupts in die()
Date: Tue, 08 Nov 2005 13:55:47 +0100	[thread overview]
Message-ID: <4370AE63.76F0.0078.0@novell.com> (raw)

[-- 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);

             reply	other threads:[~2005-11-08 12:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-08 12:55 Jan Beulich [this message]
2005-11-08 22:57 ` [PATCH] i386: don't blindly enable interrupts in die() Andrew Morton
2005-11-09  8:06   ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4370AE63.76F0.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.