]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
x86, UV: Make kdump avoid stack dumps
authorCliff Wickman <cpw@sgi.com>
Tue, 20 Jul 2010 23:09:05 +0000 (18:09 -0500)
committerH. Peter Anvin <hpa@linux.intel.com>
Wed, 21 Jul 2010 18:33:27 +0000 (11:33 -0700)
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>
arch/x86/include/asm/kdebug.h
arch/x86/kernel/apic/x2apic_uv_x.c
arch/x86/kernel/crash.c

index fa7c0b9747615ce6bd75c919b7ec884de076123c..7a2910b3512bf131f07c2028fbf73a4532b5185b 100644 (file)
@@ -33,5 +33,6 @@ extern void __show_regs(struct pt_regs *regs, int all);
 extern void show_regs(struct pt_regs *regs);
 extern unsigned long oops_begin(void);
 extern void oops_end(unsigned long, struct pt_regs *, int signr);
 extern void show_regs(struct pt_regs *regs);
 extern unsigned long oops_begin(void);
 extern void oops_end(unsigned long, struct pt_regs *, int signr);
+extern int in_crash_kexec;
 
 #endif /* _ASM_X86_KDEBUG_H */
 
 #endif /* _ASM_X86_KDEBUG_H */
index e46f98f36e31f6e1b85211a87ea62de0c497cf6c..7b598b84c902e62f9f852d78c896acb03d4ba318 100644 (file)
@@ -604,6 +604,10 @@ int uv_handle_nmi(struct notifier_block *self, unsigned long reason, void *data)
 {
        if (reason != DIE_NMI_IPI)
                return NOTIFY_OK;
 {
        if (reason != DIE_NMI_IPI)
                return NOTIFY_OK;
+
+       if (in_crash_kexec)
+               /* do nothing if entering the crash kernel */
+               return NOTIFY_OK;
        /*
         * Use a lock so only one cpu prints at a time
         * to prevent intermixed output.
        /*
         * Use a lock so only one cpu prints at a time
         * to prevent intermixed output.
index ebd4c51d096a525cbc6978561e11b3a4afbeb385..764c7c2b18115f12e3edc673940dffcdf9f3b47f 100644 (file)
@@ -28,6 +28,8 @@
 #include <asm/reboot.h>
 #include <asm/virtext.h>
 
 #include <asm/reboot.h>
 #include <asm/virtext.h>
 
+int in_crash_kexec;
+
 #if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC)
 
 static void kdump_nmi_callback(int cpu, struct die_args *args)
 #if defined(CONFIG_SMP) && defined(CONFIG_X86_LOCAL_APIC)
 
 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)
 
 static void kdump_nmi_shootdown_cpus(void)
 {
 
 static void kdump_nmi_shootdown_cpus(void)
 {
+       in_crash_kexec = 1;
        nmi_shootdown_cpus(kdump_nmi_callback);
 
        disable_local_APIC();
        nmi_shootdown_cpus(kdump_nmi_callback);
 
        disable_local_APIC();