svn commit: r366284 - head/sys/riscv/riscv

Kristof Provost kp at FreeBSD.org
Wed Sep 30 08:23:44 UTC 2020


Author: kp
Date: Wed Sep 30 08:23:43 2020
New Revision: 366284
URL: https://svnweb.freebsd.org/changeset/base/366284

Log:
  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

Modified:
  head/sys/riscv/riscv/trap.c

Modified: head/sys/riscv/riscv/trap.c
==============================================================================
--- head/sys/riscv/riscv/trap.c	Wed Sep 30 04:27:38 2020	(r366283)
+++ head/sys/riscv/riscv/trap.c	Wed Sep 30 08:23:43 2020	(r366284)
@@ -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);


More information about the svn-src-head mailing list