riscv: handle debug.debugger_on_trap for fatal page faults
Allows recovery or diagnosis of a fatal page fault before panicking the system. Reviewed by: jhb, kp Differential Revision: https://reviews.freebsd.org/D27534
This commit is contained in:
parent
78adacd4ea
commit
5a28499f2f
@ -179,6 +179,9 @@ page_fault_handler(struct trapframe *frame, int usermode)
|
|||||||
vm_offset_t va;
|
vm_offset_t va;
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
int error, sig, ucode;
|
int error, sig, ucode;
|
||||||
|
#ifdef KDB
|
||||||
|
bool handled;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef KDB
|
#ifdef KDB
|
||||||
if (kdb_active) {
|
if (kdb_active) {
|
||||||
@ -250,6 +253,15 @@ done:
|
|||||||
|
|
||||||
fatal:
|
fatal:
|
||||||
dump_regs(frame);
|
dump_regs(frame);
|
||||||
|
#ifdef KDB
|
||||||
|
if (debugger_on_trap) {
|
||||||
|
kdb_why = KDB_WHY_TRAP;
|
||||||
|
handled = kdb_trap(frame->tf_scause & SCAUSE_CODE, 0, frame);
|
||||||
|
kdb_why = KDB_WHY_UNSET;
|
||||||
|
if (handled)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
panic("Fatal page fault at %#lx: %#016lx", frame->tf_sepc, stval);
|
panic("Fatal page fault at %#lx: %#016lx", frame->tf_sepc, stval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user