[PATCH] x86: Fix boot hang due to nmi watchdog init code
authorRavikiran G Thirumalai <kiran@scalex86.org>
Sat, 9 Dec 2006 20:33:35 +0000 (21:33 +0100)
committerChris Wright <chrisw@sous-sol.org>
Mon, 11 Dec 2006 19:32:40 +0000 (11:32 -0800)
commit3667bf6de29ff04c42557e31e3e8cbbbb835732c
tree95156a3130398bb88c4cf8eb14d6d196970e4367
parenta10457ccb7a459c86a94c46680c69afbf5608f49
[PATCH] x86: Fix boot hang due to nmi watchdog init code

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.

AK: I redid the patch significantly to be cleaner

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Shai Fultheim <shai@scalex86.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
arch/i386/kernel/nmi.c
arch/x86_64/kernel/nmi.c