Skip to content

Commit fb76125

Browse files
committed
pointer masking: Let pointer masking not apply when both MPRV and MXR are set
1 parent a8cc689 commit fb76125

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

riscv/mmu.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ void mmu_t::register_memtracer(memtracer_t* t)
614614
}
615615

616616
reg_t mmu_t::get_pmlen(bool effective_virt, reg_t effective_priv) const {
617-
if (!proc || proc->get_xlen() != 64)
617+
if (!proc || proc->get_xlen() != 64 || (in_mprv() && (proc->state.sstatus->read() & MSTATUS_MXR)))
618618
return 0;
619619

620620
reg_t pmm = 0;

0 commit comments

Comments
 (0)