Commit 93efbde2 authored by Andy Lutomirski's avatar Andy Lutomirski Committed by Ingo Molnar

x86/traps: Disentangle the 32-bit and 64-bit doublefault code

The 64-bit doublefault handler is much nicer than the 32-bit one.
As a first step toward unifying them, make the 64-bit handler
self-contained.  This should have no effect no functional effect
except in the odd case of x86_64 with CONFIG_DOUBLEFAULT=n in which
case it will change the logging a bit.

This also gets rid of CONFIG_DOUBLEFAULT configurability on 64-bit
kernels.  It didn't do anything useful -- CONFIG_DOUBLEFAULT=n
didn't actually disable doublefault handling on x86_64.
Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent b09511c2
...@@ -117,7 +117,7 @@ config DEBUG_WX ...@@ -117,7 +117,7 @@ config DEBUG_WX
config DOUBLEFAULT config DOUBLEFAULT
default y default y
bool "Enable doublefault exception handler" if EXPERT bool "Enable doublefault exception handler" if EXPERT && X86_32
---help--- ---help---
This option allows trapping of rare doublefault exceptions that This option allows trapping of rare doublefault exceptions that
would otherwise cause a system to silently reboot. Disabling this would otherwise cause a system to silently reboot. Disabling this
......
...@@ -997,7 +997,6 @@ bool xen_set_default_idle(void); ...@@ -997,7 +997,6 @@ bool xen_set_default_idle(void);
#endif #endif
void stop_this_cpu(void *dummy); void stop_this_cpu(void *dummy);
void df_debug(struct pt_regs *regs, long error_code);
void microcode_check(void); void microcode_check(void);
enum l1tf_mitigations { enum l1tf_mitigations {
......
...@@ -72,15 +72,4 @@ struct x86_hw_tss doublefault_tss __cacheline_aligned = { ...@@ -72,15 +72,4 @@ struct x86_hw_tss doublefault_tss __cacheline_aligned = {
.__cr3 = __pa_nodebug(swapper_pg_dir), .__cr3 = __pa_nodebug(swapper_pg_dir),
}; };
/* dummy for do_double_fault() call */
void df_debug(struct pt_regs *regs, long error_code) {}
#else /* !CONFIG_X86_32 */
void df_debug(struct pt_regs *regs, long error_code)
{
pr_emerg("PANIC: double fault, error_code: 0x%lx\n", error_code);
show_regs(regs);
panic("Machine halted.");
}
#endif #endif
...@@ -411,15 +411,9 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code, unsign ...@@ -411,15 +411,9 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code, unsign
handle_stack_overflow("kernel stack overflow (double-fault)", regs, cr2); handle_stack_overflow("kernel stack overflow (double-fault)", regs, cr2);
#endif #endif
#ifdef CONFIG_DOUBLEFAULT pr_emerg("PANIC: double fault, error_code: 0x%lx\n", error_code);
df_debug(regs, error_code); show_regs(regs);
#endif panic("Machine halted.");
/*
* This is always a kernel trap and never fixable (and thus must
* never return).
*/
for (;;)
die(str, regs, error_code);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment