LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH], issue EOI to APIC prior to calling crash_kexec in die_nmi path
@ 2008-02-06 19:25 Neil Horman
  2008-02-06 19:40 ` Vivek Goyal
  2008-02-06 22:00 ` Ingo Molnar
  0 siblings, 2 replies; 25+ messages in thread
From: Neil Horman @ 2008-02-06 19:25 UTC (permalink / raw)
  To: linux-kernel, tglx, mingo, hpa; +Cc: nhorman, kexec

Hey all-
	A hang on kdump was reported to me awhile back, only when systems died
via nmi watchdog panic.  The hang wouldn't always be in the same place, but it
would usually be somewhere down in purgatory.  In looking at the code, it
occured to me that since, during an nmi interrupt, we won't be able to handle
additional interrupts, that we won't be able to halt the other processors on a
system like we try to do in machine_crash_shutdown.  As such, it appears that
leaving the other cpus running exposes us to the risk that another processor
will encounter an error and halt the system while we are trying to boot the
kdump kernel, and that can result in a hang.  I wrote the attached patch to end
the nmi interrupt prior to calling crash_kexec from within die_nmi, and testing
here has proven successfull.

Regards
Neil

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


 traps_32.c |    2 ++
 traps_64.c |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)


diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c
index 3cf7297..4443e8e 100644
--- a/arch/x86/kernel/traps_32.c
+++ b/arch/x86/kernel/traps_32.c
@@ -751,6 +751,8 @@ void __kprobes die_nmi(struct pt_regs *regs, const char *msg)
 	 * and might aswell get out now while we still can.
 	*/
 	if (!user_mode_vm(regs)) {
+		nmi_exit();
+		local_irq_enable();
 		current->thread.trap_no = 2;
 		crash_kexec(regs);
 	}
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index efc66df..0a50e70 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -608,8 +608,11 @@ void __kprobes die_nmi(char *str, struct pt_regs *regs, int do_panic)
 	 */
 	printk(str, smp_processor_id());
 	show_registers(regs);
-	if (kexec_should_crash(current))
+	if (kexec_should_crash(current)) {
+		nmi_exit();
+		local_irq_enable();
 		crash_kexec(regs);
+	}
 	if (do_panic || panic_on_oops)
 		panic("Non maskable interrupt");
 	oops_end(flags, NULL, SIGBUS);
-- 
/***************************************************
 *Neil Horman
 *nhorman@tuxdriver.com
 *gpg keyid: 1024D / 0x92A74FA1
 *http://pgp.mit.edu
 ***************************************************/

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

end of thread, other threads:[~2008-02-20 15:00 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-06 19:25 [PATCH], issue EOI to APIC prior to calling crash_kexec in die_nmi path Neil Horman
2008-02-06 19:40 ` Vivek Goyal
2008-02-06 20:12   ` Neil Horman
2008-02-06 20:21     ` H. Peter Anvin
2008-02-06 21:04       ` Neil Horman
2008-02-06 20:35     ` Vivek Goyal
2008-02-06 22:00 ` Ingo Molnar
2008-02-06 22:48   ` Vivek Goyal
2008-02-06 22:53     ` Ingo Molnar
2008-02-06 22:56     ` H. Peter Anvin
2008-02-06 23:36       ` Ingo Molnar
2008-02-06 23:50         ` Vivek Goyal
2008-02-07  0:31         ` Eric W. Biederman
2008-02-07  0:39           ` Ingo Molnar
2008-02-07  1:30             ` Eric W. Biederman
2008-02-07 12:17           ` Neil Horman
2008-02-07 12:24             ` Ingo Molnar
2008-02-07 20:37               ` Neil Horman
2008-02-08 16:14               ` Neil Horman
2008-02-08 16:45                 ` Vivek Goyal
2008-02-08 17:26                   ` Neil Horman
2008-02-12 21:08                   ` Neil Horman
2008-02-15 14:02                     ` Eric W. Biederman
2008-02-20 14:57                     ` Neil Horman
2008-02-08 16:54               ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).