From 1e888d7870cf8ac4bea5093353a05dad7926f88c Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Tue, 1 Dec 2015 09:52:41 +0000 Subject: [PATCH] Print useful information when we hit a data abort we can't handle. This prints the trap frame, along with the exception syndrome and fault address registers. Even though esr is 64-bits here it is only 32-bits in hardware so only print the valid 32-bits. While here also print esr and far when appropriate after printing the trap frame. Sponsored by: ABT Systems Ltd --- sys/arm64/arm64/trap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index b7db9742951a..ac810adad27c 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -186,6 +186,8 @@ data_abort(struct trapframe *frame, uint64_t esr, uint64_t far, int lower) if (td->td_critnest != 0 || WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL, "Kernel page fault") != 0) { print_registers(frame); + printf(" far: %16lx\n", far); + printf(" esr: %.8lx\n", esr); panic("data abort in critical section or under mutex"); } @@ -220,6 +222,12 @@ data_abort(struct trapframe *frame, uint64_t esr, uint64_t far, int lower) frame->tf_elr = pcb->pcb_onfault; return; } + + printf("Fatal data abort:\n"); + print_registers(frame); + printf(" far: %16lx\n", far); + printf(" esr: %.8lx\n", esr); + #ifdef KDB if (debugger_on_panic || kdb_active) if (kdb_trap(ESR_ELx_EXCEPTION(esr), 0, frame)) @@ -271,6 +279,7 @@ do_el1h_sync(struct trapframe *frame) case EXCP_FP_SIMD: case EXCP_TRAP_FP: print_registers(frame); + printf(" esr: %.8lx\n", esr); panic("VFP exception in the kernel"); case EXCP_DATA_ABORT: far = READ_SPECIALREG(far_el1);