Skip to content

Commit

Permalink
HPTW, RVH: fix the bug that non-leaf and level >= 2 pte doesn't raise…
Browse files Browse the repository at this point in the history
… pagefault. (#3078)

HPTW can translate three levels page. This bug is about non-leaf pte
that pte level >= 2. When HPTW gets a level 2 pte and the pte is valid
but RWX are zero, it does't raise pagefault. That's wrong.
  • Loading branch information
pxk27 committed Jun 15, 2024
1 parent 9810c04 commit 6613a2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/scala/xiangshan/cache/mmu/PageTableWalker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ class HPTW()(implicit p: Parameters) extends XSModule with HasPtwConst {
val finish = WireInit(false.B)

val sent_to_pmp = !idle && (!s_pmp_check || mem_addr_update) && !finish
val pageFault = pte.isPf(level)
val pageFault = pte.isPf(level) || (!pte.isLeaf() && level >= 2.U)
val accessFault = RegEnable(io.pmp.resp.ld || io.pmp.resp.mmio, sent_to_pmp)

val ppn_af = pte.isAf()
Expand Down

0 comments on commit 6613a2d

Please sign in to comment.