aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Deacon <[email protected]>2020-06-15 12:23:16 +0100
committerWill Deacon <[email protected]>2020-06-15 16:58:13 +0100
commit413d3ea6b775d77b2057f13a9af75875eb066156 (patch)
treef410d6edbfdf484e803fbbdadee6eed734244c88
parent1e570f512cbdc5e9e401ba640d9827985c1bea1e (diff)
arm64: traps: Dump registers prior to panic() in bad_mode()
When panicing due to an unknown/unhandled exception at EL1, dump the registers of the faulting context so that it's easier to figure out what went wrong. In particular, this makes it a lot easier to debug in-kernel BTI failures since it pretty-prints PSTATE.BTYPE in the crash log. Cc: Mark Brown <[email protected]> Cc: Catalin Marinas <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
-rw-r--r--arch/arm64/kernel/traps.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c
index 50cc30acf106..24f2af70ac2e 100644
--- a/arch/arm64/kernel/traps.c
+++ b/arch/arm64/kernel/traps.c
@@ -813,6 +813,7 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
handler[reason], smp_processor_id(), esr,
esr_get_class_string(esr));
+ __show_regs(regs);
local_daif_mask();
panic("bad mode");
}