summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2005-06-25 14:58:00 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 16:24:50 -0700
commit63d30298efc387c72557d11e2a7b467554c05a64 (patch)
tree04516446aae4e1e47e6d2f8c63e84a4c02bddeaf /arch
parent2c818b45a202b8f632b4031edcba8599efda42b7 (diff)
downloadop-kernel-dev-63d30298efc387c72557d11e2a7b467554c05a64.zip
op-kernel-dev-63d30298efc387c72557d11e2a7b467554c05a64.tar.gz
[PATCH] kexec: x86 shutdown APICs during crash_shutdown
In the case of a crash/panic an architecture specific function machine_crash_shutdown is called. This patch adds to the x86 machine_crash function the standard kernel code for shutting down apics. Every line of code added to that function increases the risk that we will call code after a kernel panic that is not safe. This patch should not make it to the stable kernel without a being reviewed a lot more. It is unclear how much a hardned kernel can take when it comes to misconfigured apics. So since a normal kernel has problems this patch does a clean shutdown. It is my expectation this patch will be dropped from future generations of the kexec work. But for the moment it is a crutch to keep from breaking everything. Signed-off-by: Eric Biederman <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/crash.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c
index 1bb5dd9..59b92d2 100644
--- a/arch/i386/kernel/crash.c
+++ b/arch/i386/kernel/crash.c
@@ -23,6 +23,7 @@
#include <asm/hardirq.h>
#include <asm/nmi.h>
#include <asm/hw_irq.h>
+#include <asm/apic.h>
#include <mach_ipi.h>
#define MAX_NOTE_BYTES 1024
@@ -115,6 +116,7 @@ static int crash_nmi_callback(struct pt_regs *regs, int cpu)
{
local_irq_disable();
crash_save_this_cpu(regs, cpu);
+ disable_local_APIC();
atomic_dec(&waiting_for_crash_ipi);
/* Assume hlt works */
__asm__("hlt");
@@ -153,6 +155,7 @@ static void nmi_shootdown_cpus(void)
}
/* Leave the nmi callback set */
+ disable_local_APIC();
}
#else
static void nmi_shootdown_cpus(void)
@@ -174,5 +177,9 @@ void machine_crash_shutdown(void)
/* The kernel is broken so disable interrupts */
local_irq_disable();
nmi_shootdown_cpus();
+ lapic_shutdown();
+#if defined(CONFIG_X86_IO_APIC)
+ disable_IO_APIC();
+#endif
crash_save_self();
}
OpenPOWER on IntegriCloud