Separate page faults from physical memory access exceptions
authorAndrew Waterman <andrew@sifive.com>
Mon, 27 Mar 2017 21:26:09 +0000 (14:26 -0700)
committerAndrew Waterman <andrew@sifive.com>
Mon, 27 Mar 2017 21:27:08 +0000 (14:27 -0700)
benchmarks/pmp/pmp.c
env
isa/rv64si/dirty.S

index 07eed8b6334429e2071181503fccb39b41290b90..055ec79a12c8161d9d5f37e621e71f20602b9552 100644 (file)
@@ -16,7 +16,7 @@ uintptr_t handle_trap(uintptr_t cause, uintptr_t epc, uintptr_t regs[32])
   if (cause == CAUSE_ILLEGAL_INSTRUCTION)
     exit(0); // no PMP support
 
-  if (!trap_expected)
+  if (!trap_expected || cause != CAUSE_LOAD_ACCESS)
     exit(1);
   trap_expected = 0;
   return epc + insn_len(epc);
diff --git a/env b/env
index 3dc64058de56fbac3b793e20707739f0b985303c..47fef2b463a484f3dafe979ec4e646990460dece 160000 (submodule)
--- a/env
+++ b/env
@@ -1 +1 @@
-Subproject commit 3dc64058de56fbac3b793e20707739f0b985303c
+Subproject commit 47fef2b463a484f3dafe979ec4e646990460dece
index 06c978068330158bee83d8c1803cd0e964197e5e..86e4656059fb8ae395607c55c8c281a096d5bb07 100644 (file)
@@ -58,7 +58,7 @@ RVTEST_CODE_BEGIN
   .align 2
 stvec_handler:
   csrr t0, scause
-  add t0, t0, -CAUSE_FAULT_STORE
+  add t0, t0, -CAUSE_STORE_PAGE_FAULT
   bnez t0, die
 
   li t1, 2