diff options
author | Cliff Wickman <cpw@sgi.com> | 2010-07-20 19:09:05 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2010-07-21 14:33:27 -0400 |
commit | 5edd19af18a36a4e22c570b1b969179e0ca1fe4c (patch) | |
tree | ad4c52f24218c1358d8e8ea51d2ce23a20c37d68 /arch/x86/kernel | |
parent | 93a7ca0c3ebe5d931126f1fb732cb9c4518383d4 (diff) |
x86, UV: Make kdump avoid stack dumps
UV NMI callback's should not write stack dumps when a kdump is to be written.
When invoking the crash kernel to write a dump, kdump_nmi_shootdown_cpus()
uses NMI's to get all the cpu's to save their register context and halt.
But the NMI interrupt handler runs a callback list. This patch sets a flag
to prevent any of those callbacks from interfering with the halt of the cpu.
For UV, which currently has the only callback to which this is relevant, the
uv_handle_nmi() callback should not do dumping of stacks.
The 'in_crash_kexec' flag is defined as an extern in kdebug.h firstly
because x2apic_uv_x.c includes it. Secondly because some future callback
might need the flag to know that it should not enter the debugger.
(Such a scenario was in fact present in the 2.6.32 kernel, SuSE distribution,
where a call to kdb needed to be avoided.)
Signed-off-by: Cliff Wickman <cpw@sgi.com>
LKML-Reference: <E1ObLvt-0005UZ-Va@eag09.americas.sgi.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/crash.c | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index e46f98f36e31..7b598b84c902 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -604,6 +604,10 @@ int uv_handle_nmi(struct notifier_block *self, unsigned long reason, void *data) | |||
604 | { | 604 | { |
605 | if (reason != DIE_NMI_IPI) | 605 | if (reason != DIE_NMI_IPI) |
606 | return NOTIFY_OK; | 606 | return NOTIFY_OK; |
607 | |||
608 | if (in_crash_kexec) | ||
609 | /* do nothing if entering the crash kernel */ | ||
610 | return NOTIFY_OK; | ||
607 | /* | 611 | /* |
608 | * Use a lock so only one cpu prints at a time | 612 | * Use a lock so only one cpu prints at a time |
609 | * to prevent intermixed output. | 613 | * to prevent intermixed output. |
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index ebd4c51d096a..764c7c2b1811 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <asm/reboot.h> | 28 | #include <asm/reboot.h> |
29 | #include <asm/virtext.h> | 29 | #include <asm/virtext.h> |
30 | 30 | ||
31 | int in_crash_kexec; | ||
32 | |||
31 | #if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC) | 33 | #if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC) |
32 | 34 | ||
33 | static void kdump_nmi_callback(int cpu, struct die_args *args) | 35 | static void kdump_nmi_callback(int cpu, struct die_args *args) |
@@ -61,6 +63,7 @@ static void kdump_nmi_callback(int cpu, struct die_args *args) | |||
61 | 63 | ||
62 | static void kdump_nmi_shootdown_cpus(void) | 64 | static void kdump_nmi_shootdown_cpus(void) |
63 | { | 65 | { |
66 | in_crash_kexec = 1; | ||
64 | nmi_shootdown_cpus(kdump_nmi_callback); | 67 | nmi_shootdown_cpus(kdump_nmi_callback); |
65 | 68 | ||
66 | disable_local_APIC(); | 69 | disable_local_APIC(); |