Commit 413d3ea6 authored by Will Deacon's avatar Will Deacon

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 <broonie@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20200615113458.2884-1-will@kernel.orgSigned-off-by: default avatarWill Deacon <will@kernel.org>
parent 1e570f51
...@@ -813,6 +813,7 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr) ...@@ -813,6 +813,7 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
handler[reason], smp_processor_id(), esr, handler[reason], smp_processor_id(), esr,
esr_get_class_string(esr)); esr_get_class_string(esr));
__show_regs(regs);
local_daif_mask(); local_daif_mask();
panic("bad mode"); panic("bad mode");
} }
......
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