Skip to content

Commit 1b53bf9

Browse files
authored
Merge pull request #1760 from YenHaoChen/pr-mxr
Let MXR not affect implicit memory access for VS-stage address translation
2 parents 2890ea7 + e749bb0 commit 1b53bf9

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
@@ -404,7 +404,7 @@ reg_t mmu_t::s2xlate(reg_t gva, reg_t gpa, access_type type, access_type trap_ty
404404
int maxgpabits = vm.levels * vm.idxbits + vm.widenbits + PGSHIFT;
405405
reg_t maxgpa = (1ULL << maxgpabits) - 1;
406406

407-
bool mxr = proc->state.sstatus->readvirt(false) & MSTATUS_MXR;
407+
bool mxr = !is_for_vs_pt_addr && (proc->state.sstatus->readvirt(false) & MSTATUS_MXR);
408408
// tinst is set to 0x3000/0x3020 - for RV64 read/write respectively for
409409
// VS-stage address translation (for spike HSXLEN == VSXLEN always) else
410410
// tinst is set to 0x2000/0x2020 - for RV32 read/write respectively for

0 commit comments

Comments
 (0)