Skip to content

Commit 413d3ea

Browse files
committed
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]>
1 parent 1e570f5 commit 413d3ea

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/arm64/kernel/traps.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,7 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason, unsigned int esr)
813813
handler[reason], smp_processor_id(), esr,
814814
esr_get_class_string(esr));
815815

816+
__show_regs(regs);
816817
local_daif_mask();
817818
panic("bad mode");
818819
}

0 commit comments

Comments
 (0)