From 71bdc3bbd13a635637d730b2152aff912a929074 Mon Sep 17 00:00:00 2001 From: YenHaoChen Date: Mon, 26 Aug 2024 14:18:51 +0800 Subject: [PATCH] pointer masking: Pointer masking does not apply when MXR=1 regardless of MPRV in v1.0.0-rc2 Reference: https://github.com/riscv/riscv-j-extension/issues/70 --- riscv/mmu.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv/mmu.cc b/riscv/mmu.cc index 5d3454163..e827f4ad3 100644 --- a/riscv/mmu.cc +++ b/riscv/mmu.cc @@ -614,7 +614,7 @@ void mmu_t::register_memtracer(memtracer_t* t) } reg_t mmu_t::get_pmlen(bool effective_virt, reg_t effective_priv, xlate_flags_t flags) const { - if (!proc || proc->get_xlen() != 64 || (in_mprv() && (proc->state.sstatus->read() & MSTATUS_MXR)) || flags.hlvx) + if (!proc || proc->get_xlen() != 64 || (proc->state.sstatus->read() & MSTATUS_MXR) || flags.hlvx) return 0; reg_t pmm = 0;