projects
/
riscv-isa-sim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e10d2de
)
Fix page table walker not respecting valid bit
author
Andrew Waterman
<waterman@cs.berkeley.edu>
Tue, 12 Jul 2016 19:43:07 +0000
(12:43 -0700)
committer
Andrew Waterman
<waterman@cs.berkeley.edu>
Tue, 12 Jul 2016 19:43:07 +0000
(12:43 -0700)
riscv/mmu.cc
patch
|
blob
|
history
diff --git
a/riscv/mmu.cc
b/riscv/mmu.cc
index 602b09010399899a79c2db74248d310a5fe51e8b..4b7166f44bb5038a8f17a51f9486400bed7adf8a 100644
(file)
--- a/
riscv/mmu.cc
+++ b/
riscv/mmu.cc
@@
-153,7
+153,7
@@
reg_t mmu_t::walk(reg_t addr, access_type type, reg_t mode)
base = ppn << PGSHIFT;
} else if ((pte & PTE_U) ? supervisor && pum : !supervisor) {
break;
- } else if (!(pte & PTE_
R) && (pte & PTE_W)) { // reserved
+ } else if (!(pte & PTE_
V) || (!(pte & PTE_R) && (pte & PTE_W))) {
break;
} else if (type == FETCH ? !(pte & PTE_X) :
type == LOAD ? !(pte & PTE_R) && !(mxr && (pte & PTE_X)) :