Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1947551AbWLIAEE (ORCPT ); Fri, 8 Dec 2006 19:04:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1947557AbWLIADi (ORCPT ); Fri, 8 Dec 2006 19:03:38 -0500 Received: from 216-99-217-87.dsl.aracnet.com ([216.99.217.87]:37669 "EHLO sous-sol.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1947543AbWLIACH (ORCPT ); Fri, 8 Dec 2006 19:02:07 -0500 Message-Id: <20061209000328.188464000@sous-sol.org> References: <20061208235751.890503000@sous-sol.org> User-Agent: quilt/0.45-1 Date: Fri, 08 Dec 2006 15:58:22 -0800 From: Chris Wright To: linux-kernel@vger.kernel.org, stable@kernel.org, ak@muc.de Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk, shai@scalex86.org, kiran@scalex86.org Subject: [patch 31/32] x86_64: fix boot hang due to nmi watchdog init code Content-Disposition: inline; filename=x86_64-fix-boot-hang-due-to-nmi-watchdog-init-code.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2038 Lines: 60 -stable review patch. If anyone has any objections, please let us know. ------------------ From: Ravikiran G Thirumalai 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. [akpm@osdl.org: cleanups] Signed-off-by: Ravikiran Thirumalai Signed-off-by: Shai Fultheim Cc: Andi Kleen Cc: Signed-off-by: Andrew Morton Signed-off-by: Chris Wright --- arch/x86_64/kernel/nmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- linux-2.6.19.orig/arch/x86_64/kernel/nmi.c +++ linux-2.6.19/arch/x86_64/kernel/nmi.c @@ -212,7 +212,7 @@ static __init void nmi_cpu_busy(void *da int __init check_nmi_watchdog (void) { - volatile int endflag = 0; + static int __initdata endflag; int *counts; int cpu; @@ -253,6 +253,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; -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/