public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kexec: fix hang on i386 when panic occurs while console_sem is held
@ 2008-10-17 21:00 Neil Horman
  2008-10-20 12:13 ` Ingo Molnar
  0 siblings, 1 reply; 29+ messages in thread
From: Neil Horman @ 2008-10-17 21:00 UTC (permalink / raw)
  To: kexec, linux-kernel
  Cc: vgoyal, hbabu, ebiederm, tglx, mingo, hpa, nhorman, akpm

Hey all-
	Theres a corner case in 32 bit x86 kdump at the moment.  When the box
panics via nmi, we call bust_spinlocks(1) to disable sensitivity to the
console_sem (allowing us to print to the console in all cases), but we don't
call crash_kexec, until after we call bust_spinlocks(0), which re-enables
console_sem sensitivity.  The result is that, if we get an nmi while the
console_sem is held and kdump is configured, and we try to print something to
the console during kdump shutdown (which we often do) we deadlock the box.  The
fix is to simply do what 64 bit die_nmi does which is to not call
bust_spinlocks(0) until after we call crash_kexec.  Patch below tested
successfully by me:

Regards
Neil

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>


 dumpstack_32.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index 1a78180..b361475 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -405,7 +405,6 @@ die_nmi(char *str, struct pt_regs *regs, int do_panic)
 		panic("Non maskable interrupt");
 	console_silent();
 	spin_unlock(&nmi_print_lock);
-	bust_spinlocks(0);
 
 	/*
 	 * If we are in kernel we are probably nested up pretty bad
@@ -416,6 +415,7 @@ die_nmi(char *str, struct pt_regs *regs, int do_panic)
 		crash_kexec(regs);
 	}
 
+	bust_spinlocks(0);
 	do_exit(SIGSEGV);
 }
 
-- 
/****************************************************
 * Neil Horman <nhorman@tuxdriver.com>
 * Software Engineer, Red Hat
 ****************************************************/

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2008-10-23  9:22 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-17 21:00 [PATCH] kexec: fix hang on i386 when panic occurs while console_sem is held Neil Horman
2008-10-20 12:13 ` Ingo Molnar
2008-10-20 13:42   ` Neil Horman
2008-10-20 15:07     ` [PATCH] x86, dumpstack: some more unification Alexander van Heukelum
2008-10-20 15:08       ` [PATCH] x86: make oops_begin and oops_end equal Alexander van Heukelum
2008-10-20 15:11         ` [PATCH] x86, dumpstack: make die and die_nmi equal Alexander van Heukelum
2008-10-21 14:59           ` Neil Horman
2008-10-22 10:00             ` [PATCH 0/7] x86, dumpstack: unify oops_begin, oops_end, die_nmi and die Alexander van Heukelum
2008-10-22 10:00               ` [PATCH 1/7] i386, dumpstack: Move crash_kexec before bust_spinlocks(0) in oops_end Alexander van Heukelum
2008-10-22 10:00                 ` [PATCH 2/7] x86, dumpstack: let signr=0 signal no do_exit Alexander van Heukelum
2008-10-22 10:00                   ` [PATCH 3/7] x86_64, dumpstack: move kexec_crash from __die to oops_end Alexander van Heukelum
2008-10-22 10:00                     ` [PATCH 4/7] x86, dumpstack: always call oops_exit from oops_end Alexander van Heukelum
2008-10-22 10:00                       ` [PATCH 5/7] i386, dumpstack: use x86_64's method to account die_nest_count Alexander van Heukelum
2008-10-22 10:00                         ` [PATCH 6/7] i386, dumpstack: use oops_begin/oops_end in die_nmi Alexander van Heukelum
2008-10-22 10:00                           ` [PATCH 7/7] i386, dumpstack: unify die() Alexander van Heukelum
2008-10-22 13:37                             ` Neil Horman
2008-10-22 12:36                           ` [PATCH 6/7] i386, dumpstack: use oops_begin/oops_end in die_nmi Neil Horman
2008-10-22 11:18                         ` [PATCH 5/7] i386, dumpstack: use x86_64's method to account die_nest_count Neil Horman
2008-10-22 11:14                       ` [PATCH 4/7] x86, dumpstack: always call oops_exit from oops_end Neil Horman
2008-10-22 11:11                     ` [PATCH 3/7] x86_64, dumpstack: move kexec_crash from __die to oops_end Neil Horman
2008-10-22 11:01                   ` [PATCH 2/7] x86, dumpstack: let signr=0 signal no do_exit Neil Horman
2008-10-22 10:49                 ` [PATCH 1/7] i386, dumpstack: Move crash_kexec before bust_spinlocks(0) in oops_end Neil Horman
2008-10-21 14:45         ` [PATCH] x86: make oops_begin and oops_end equal Neil Horman
2008-10-22 10:18           ` Alexander van Heukelum
2008-10-22 10:45             ` Neil Horman
2008-10-22 12:02               ` Ingo Molnar
2008-10-22 19:19                 ` Neil Horman
2008-10-23  9:22                   ` Alexander van Heukelum
2008-10-20 16:51       ` [PATCH] x86, dumpstack: some more unification Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox