diff options
| author | Eric W. Biederman <ebiederm@xmission.com> | 2005-06-25 17:58:00 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-25 19:24:50 -0400 |
| commit | 63d30298efc387c72557d11e2a7b467554c05a64 (patch) | |
| tree | 04516446aae4e1e47e6d2f8c63e84a4c02bddeaf | |
| parent | 2c818b45a202b8f632b4031edcba8599efda42b7 (diff) | |
[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>
| -rw-r--r-- | arch/i386/kernel/crash.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/i386/kernel/crash.c b/arch/i386/kernel/crash.c index 1bb5dd98d1d4..59b92d217464 100644 --- a/arch/i386/kernel/crash.c +++ b/arch/i386/kernel/crash.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <asm/hardirq.h> | 23 | #include <asm/hardirq.h> |
| 24 | #include <asm/nmi.h> | 24 | #include <asm/nmi.h> |
| 25 | #include <asm/hw_irq.h> | 25 | #include <asm/hw_irq.h> |
| 26 | #include <asm/apic.h> | ||
| 26 | #include <mach_ipi.h> | 27 | #include <mach_ipi.h> |
| 27 | 28 | ||
| 28 | #define MAX_NOTE_BYTES 1024 | 29 | #define MAX_NOTE_BYTES 1024 |
| @@ -115,6 +116,7 @@ static int crash_nmi_callback(struct pt_regs *regs, int cpu) | |||
| 115 | { | 116 | { |
| 116 | local_irq_disable(); | 117 | local_irq_disable(); |
| 117 | crash_save_this_cpu(regs, cpu); | 118 | crash_save_this_cpu(regs, cpu); |
| 119 | disable_local_APIC(); | ||
| 118 | atomic_dec(&waiting_for_crash_ipi); | 120 | atomic_dec(&waiting_for_crash_ipi); |
| 119 | /* Assume hlt works */ | 121 | /* Assume hlt works */ |
| 120 | __asm__("hlt"); | 122 | __asm__("hlt"); |
| @@ -153,6 +155,7 @@ static void nmi_shootdown_cpus(void) | |||
| 153 | } | 155 | } |
| 154 | 156 | ||
| 155 | /* Leave the nmi callback set */ | 157 | /* Leave the nmi callback set */ |
| 158 | disable_local_APIC(); | ||
| 156 | } | 159 | } |
| 157 | #else | 160 | #else |
| 158 | static void nmi_shootdown_cpus(void) | 161 | static void nmi_shootdown_cpus(void) |
| @@ -174,5 +177,9 @@ void machine_crash_shutdown(void) | |||
| 174 | /* The kernel is broken so disable interrupts */ | 177 | /* The kernel is broken so disable interrupts */ |
| 175 | local_irq_disable(); | 178 | local_irq_disable(); |
| 176 | nmi_shootdown_cpus(); | 179 | nmi_shootdown_cpus(); |
| 180 | lapic_shutdown(); | ||
| 181 | #if defined(CONFIG_X86_IO_APIC) | ||
| 182 | disable_IO_APIC(); | ||
| 183 | #endif | ||
| 177 | crash_save_self(); | 184 | crash_save_self(); |
| 178 | } | 185 | } |
