aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/Kconfig.debug1
-rw-r--r--arch/x86/include/asm/processor.h2
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/kernel/doublefault.c (renamed from arch/x86/kernel/doublefault_32.c)15
-rw-r--r--arch/x86/kernel/traps.c3
5 files changed, 20 insertions, 3 deletions
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index c198b7e13e7b..b6a770132b67 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -122,7 +122,6 @@ config DEBUG_NX_TEST
122config DOUBLEFAULT 122config DOUBLEFAULT
123 default y 123 default y
124 bool "Enable doublefault exception handler" if EXPERT 124 bool "Enable doublefault exception handler" if EXPERT
125 depends on X86_32
126 ---help--- 125 ---help---
127 This option allows trapping of rare doublefault exceptions that 126 This option allows trapping of rare doublefault exceptions that
128 would otherwise cause a system to silently reboot. Disabling this 127 would otherwise cause a system to silently reboot. Disabling this
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 22224b3b43bb..5b87d52eed0b 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -981,5 +981,5 @@ bool xen_set_default_idle(void);
981#endif 981#endif
982 982
983void stop_this_cpu(void *dummy); 983void stop_this_cpu(void *dummy);
984 984void df_debug(struct pt_regs *regs, long error_code);
985#endif /* _ASM_X86_PROCESSOR_H */ 985#endif /* _ASM_X86_PROCESSOR_H */
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 7bd3bd310106..4ce822ed58f5 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -67,7 +67,7 @@ obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o
67obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o 67obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o
68obj-y += kprobes/ 68obj-y += kprobes/
69obj-$(CONFIG_MODULES) += module.o 69obj-$(CONFIG_MODULES) += module.o
70obj-$(CONFIG_DOUBLEFAULT) += doublefault_32.o 70obj-$(CONFIG_DOUBLEFAULT) += doublefault.o
71obj-$(CONFIG_KGDB) += kgdb.o 71obj-$(CONFIG_KGDB) += kgdb.o
72obj-$(CONFIG_VM86) += vm86_32.o 72obj-$(CONFIG_VM86) += vm86_32.o
73obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 73obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
diff --git a/arch/x86/kernel/doublefault_32.c b/arch/x86/kernel/doublefault.c
index 155a13f33ed8..5d3fe8d36e4a 100644
--- a/arch/x86/kernel/doublefault_32.c
+++ b/arch/x86/kernel/doublefault.c
@@ -9,6 +9,8 @@
9#include <asm/processor.h> 9#include <asm/processor.h>
10#include <asm/desc.h> 10#include <asm/desc.h>
11 11
12#ifdef CONFIG_X86_32
13
12#define DOUBLEFAULT_STACKSIZE (1024) 14#define DOUBLEFAULT_STACKSIZE (1024)
13static unsigned long doublefault_stack[DOUBLEFAULT_STACKSIZE]; 15static unsigned long doublefault_stack[DOUBLEFAULT_STACKSIZE];
14#define STACK_START (unsigned long)(doublefault_stack+DOUBLEFAULT_STACKSIZE) 16#define STACK_START (unsigned long)(doublefault_stack+DOUBLEFAULT_STACKSIZE)
@@ -67,3 +69,16 @@ struct tss_struct doublefault_tss __cacheline_aligned = {
67 .__cr3 = __pa_nodebug(swapper_pg_dir), 69 .__cr3 = __pa_nodebug(swapper_pg_dir),
68 } 70 }
69}; 71};
72
73/* dummy for do_double_fault() call */
74void df_debug(struct pt_regs *regs, long error_code) {}
75
76#else /* !CONFIG_X86_32 */
77
78void df_debug(struct pt_regs *regs, long error_code)
79{
80 pr_emerg("PANIC: double fault, error_code: 0x%lx\n", error_code);
81 show_regs(regs);
82 panic("Machine halted.");
83}
84#endif
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 772e2a846dec..167d481c5fd3 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -254,6 +254,9 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
254 tsk->thread.error_code = error_code; 254 tsk->thread.error_code = error_code;
255 tsk->thread.trap_nr = X86_TRAP_DF; 255 tsk->thread.trap_nr = X86_TRAP_DF;
256 256
257#ifdef CONFIG_DOUBLEFAULT
258 df_debug(regs, error_code);
259#endif
257 /* 260 /*
258 * This is always a kernel trap and never fixable (and thus must 261 * This is always a kernel trap and never fixable (and thus must
259 * never return). 262 * never return).