Print useful debug data on unhandled kernel fault on arm64

When panicing because of an unhandled data abort from the kernel it is
useful to know the register state and faulting address to aid debugging.
Print these registers before calling panic.

Sponsored by:	DARPA, AFRL
This commit is contained in:
andrew 2020-02-04 12:33:00 +00:00
parent 881f0f9409
commit 6371e0efd7

View File

@ -357,12 +357,15 @@ do_el1h_sync(struct thread *td, struct trapframe *frame)
far = READ_SPECIALREG(far_el1);
dfsc = esr & ISS_DATA_DFSC_MASK;
if (dfsc < nitems(abort_handlers) &&
abort_handlers[dfsc] != NULL)
abort_handlers[dfsc] != NULL) {
abort_handlers[dfsc](td, frame, esr, far, 0);
else
} else {
print_registers(frame);
printf(" far: %16lx\n", far);
panic("Unhandled EL1 %s abort: %x",
exception == EXCP_INSN_ABORT ? "instruction" :
"data", dfsc);
}
break;
case EXCP_BRK:
#ifdef KDTRACE_HOOKS