[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)
committerAndi Kleen <andi@basil.nowhere.org>
Sat, 9 Dec 2006 20:33:35 +0000 (21:33 +0100)
commit92715e282be7c7488f892703c8d39b08976a833b
tree49acd962775f5a113483b16bbcc9c504728215ca
parent16d279d277aedd640d9dba5ddeb172b5e6bc7d75
[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>
arch/i386/kernel/nmi.c
arch/x86_64/kernel/nmi.c