From 61d277c49c7843476abe671f05aa78f08e6278b2 Mon Sep 17 00:00:00 2001 From: YenHaoChen Date: Wed, 28 Aug 2024 11:34:57 +0800 Subject: [PATCH] pointer masking: Consider effective v bit instead of current v bit A previous commit removes the effectiveness of MPRV to MXR. (https://github.com/riscv-software-src/riscv-isa-sim/pull/1784) However, the removal implies the MPRV affects point masking individually, and the MXR should consider the effective v bit. --- riscv/mmu.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riscv/mmu.cc b/riscv/mmu.cc index e827f4ad3..ea86900da 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 || (proc->state.sstatus->read() & MSTATUS_MXR) || flags.hlvx) + if (!proc || proc->get_xlen() != 64 || (proc->state.sstatus->readvirt(effective_virt) & MSTATUS_MXR) || flags.hlvx) return 0; reg_t pmm = 0;