[tip: x86/urgent] x86/traps: die() instead of panicking on a double fault

From: tip-bot2 for Andy Lutomirski
Date: Wed Nov 27 2019 - 03:19:37 EST


The following commit has been merged into the x86/urgent branch of tip:

Commit-ID: 0337b7ebfcb8efb4ea0a9f2b2f284217a1c0e62d
Gitweb: https://git.kernel.org/tip/0337b7ebfcb8efb4ea0a9f2b2f284217a1c0e62d
Author: Andy Lutomirski <luto@xxxxxxxxxx>
AuthorDate: Mon, 25 Nov 2019 22:37:44 -08:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Tue, 26 Nov 2019 22:00:12 +01:00

x86/traps: die() instead of panicking on a double fault

A double fault has a decent chance of being recoverable by killing
the offending thread. Use die() so that we at least try to recover.

Signed-off-by: Andy Lutomirski <luto@xxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
---
arch/x86/kernel/traps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index a9b16c3..05da6b5 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -427,7 +427,7 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code, unsign
#endif

pr_emerg("PANIC: double fault, error_code: 0x%lx\n", error_code);
- show_regs(regs);
+ die("double fault", regs, error_code);
panic("Machine halted.");
}
#endif