aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ingalls <43973001+ingallsj@users.noreply.github.com>2021-12-04 23:36:56 -0800
committerGitHub <noreply@github.com>2021-12-04 23:36:56 -0800
commitc4fdc8fe95e497ab6e107117a7de47ec40e7de7d (patch)
treebf26a30abb5b95c970f9105edbadb9e60a60adb5
parenta9b3babb8f27c063213d6189f4862269756a1a0c (diff)
downloadspike-c4fdc8fe95e497ab6e107117a7de47ec40e7de7d.zip
spike-c4fdc8fe95e497ab6e107117a7de47ec40e7de7d.tar.gz
spike-c4fdc8fe95e497ab6e107117a7de47ec40e7de7d.tar.bz2
page fault when PTE_PBMT bits set and not EXT_SVPBMT (#874)
-rw-r--r--riscv/mmu.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/riscv/mmu.cc b/riscv/mmu.cc
index eed656a..e33b814 100644
--- a/riscv/mmu.cc
+++ b/riscv/mmu.cc
@@ -291,6 +291,8 @@ reg_t mmu_t::s2xlate(reg_t gva, reg_t gpa, access_type type, access_type trap_ty
if (pte & PTE_RSVD) {
break;
+ } else if (!proc->extension_enabled(EXT_SVPBMT) && (pte & PTE_PBMT)) {
+ break;
} else if (PTE_TABLE(pte)) { // next level of page table
if (pte & (PTE_D | PTE_A | PTE_U | PTE_N | PTE_PBMT))
break;
@@ -377,6 +379,8 @@ reg_t mmu_t::walk(reg_t addr, access_type type, reg_t mode, bool virt, bool hlvx
if (pte & PTE_RSVD) {
break;
+ } else if (!proc->extension_enabled(EXT_SVPBMT) && (pte & PTE_PBMT)) {
+ break;
} else if (PTE_TABLE(pte)) { // next level of page table
if (pte & (PTE_D | PTE_A | PTE_U | PTE_N | PTE_PBMT))
break;