aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/dumpstack_32.c
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2008-10-17 17:00:13 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-22 07:59:44 -0400
commitcf52ebedba77ee494b495dedd3a1f55944611275 (patch)
tree2105256f17c6869d87c3a08cf41055fb6cef0169 /arch/x86/kernel/dumpstack_32.c
parentd2f6f7aeee890df445be29a60e34925ec15f620c (diff)
x86, kexec: fix hang on i386 when panic occurs while console_sem is held
There's 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. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/dumpstack_32.c')
-rw-r--r--arch/x86/kernel/dumpstack_32.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index 1a78180f08d3..b3614752197b 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)
405 panic("Non maskable interrupt"); 405 panic("Non maskable interrupt");
406 console_silent(); 406 console_silent();
407 spin_unlock(&nmi_print_lock); 407 spin_unlock(&nmi_print_lock);
408 bust_spinlocks(0);
409 408
410 /* 409 /*
411 * If we are in kernel we are probably nested up pretty bad 410 * 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)
416 crash_kexec(regs); 415 crash_kexec(regs);
417 } 416 }
418 417
418 bust_spinlocks(0);
419 do_exit(SIGSEGV); 419 do_exit(SIGSEGV);
420} 420}
421 421