From: Ravikiran G Thirumalai <kiran@scalex86.org>
To: Andi Kleen <ak@suse.de>, greg@kroah.com, chrisw@sous-sol.org
Cc: linux-kernel@vger.kernel.org, stable@kernel.org,
"Shai Fultheim (Shai@scalex86.org)" <shai@scalex86.org>,
"Benzi Galili (Benzi@ScaleMP.com)" <benzi@scalemp.com>
Subject: [patch] x86_64: Fix boot hang due to nmi watchdog init code
Date: Tue, 5 Dec 2006 00:10:56 -0800 [thread overview]
Message-ID: <20061205081056.GA3730@localhost.localdomain> (raw)
2.6.19 stopped booting (or booted based on build/config) on our x86_64
systems due to a bug introduced in 2.6.19. check_nmi_watchdog schedules an
IPI on all cpus to busy wait on a flag, but fails to set the busywait
flag if NMI functionality is disabled. This causes the secondary cpus
to spin in an endless loop, causing the kernel bootup to hang.
Depending upon the build, the busywait flag got overwritten (stack variable)
and caused the kernel to bootup on certain builds. Following patch fixes
the bug by setting the busywait flag before returning from check_nmi_watchdog.
I guess using a stack variable is not good here as the calling function could
potentially return while the busy wait loop is still spinning on the flag.
I would think this is a good candidate for 2.6.19 stable as well.
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Index: linux-2.6.19/arch/x86_64/kernel/nmi.c
===================================================================
--- linux-2.6.19.orig/arch/x86_64/kernel/nmi.c 2006-11-29 13:57:37.000000000 -0800
+++ linux-2.6.19/arch/x86_64/kernel/nmi.c 2006-12-04 18:02:42.462737000 -0800
@@ -210,9 +210,10 @@ static __init void nmi_cpu_busy(void *da
}
#endif
+static int endflag = 0;
+
int __init check_nmi_watchdog (void)
{
- volatile int endflag = 0;
int *counts;
int cpu;
@@ -253,6 +254,7 @@ int __init check_nmi_watchdog (void)
if (!atomic_read(&nmi_active)) {
kfree(counts);
atomic_set(&nmi_active, -1);
+ endflag = 1;
return -1;
}
endflag = 1;
reply other threads:[~2006-12-05 8:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20061205081056.GA3730@localhost.localdomain \
--to=kiran@scalex86.org \
--cc=ak@suse.de \
--cc=benzi@scalemp.com \
--cc=chrisw@sous-sol.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shai@scalex86.org \
--cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox