aboutsummaryrefslogtreecommitdiff
path: root/sys/riscv
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2020-09-30 08:23:43 +0000
committerKristof Provost <kp@FreeBSD.org>2020-09-30 08:23:43 +0000
commit0d3aa0fb643e9c65f8f19d64574b419200a0cc8d (patch)
tree2b63d7f530ec234add3c30b113dd67eace936dbb /sys/riscv
parentd4cac59429b1ddb3345d02ececd60544a656d42c (diff)
downloadsrc-0d3aa0fb643e9c65f8f19d64574b419200a0cc8d.tar.gz
src-0d3aa0fb643e9c65f8f19d64574b419200a0cc8d.zip
riscv: Panic on PMP errors
Load/store/fetch access exceptions always indicate a violation of a PMP rule. We can't treat those as page faults, because updating the page table and trying again will only result in exactly the same access exception recurring. This leaves us in an endless exception loop. We cannot recover from these exceptions, so panic instead. Reviewed by: jhb Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D26544
Notes
Notes: svn path=/head/; revision=366284
Diffstat (limited to 'sys/riscv')
-rw-r--r--sys/riscv/riscv/trap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/riscv/riscv/trap.c b/sys/riscv/riscv/trap.c
index 0992d1ca361a..87f088f18fa4 100644
--- a/sys/riscv/riscv/trap.c
+++ b/sys/riscv/riscv/trap.c
@@ -282,6 +282,9 @@ do_trap_supervisor(struct trapframe *frame)
case EXCP_FAULT_LOAD:
case EXCP_FAULT_STORE:
case EXCP_FAULT_FETCH:
+ dump_regs(frame);
+ panic("Memory access exception at 0x%016lx\n", frame->tf_sepc);
+ break;
case EXCP_STORE_PAGE_FAULT:
case EXCP_LOAD_PAGE_FAULT:
data_abort(frame, 0);