Skip to content

Commit

Permalink
Merge pull request #1760 from YenHaoChen/pr-mxr
Browse files Browse the repository at this point in the history
Let MXR not affect implicit memory access for VS-stage address translation
  • Loading branch information
aswaterman authored Aug 5, 2024
2 parents 2890ea7 + e749bb0 commit 1b53bf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion riscv/mmu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ reg_t mmu_t::s2xlate(reg_t gva, reg_t gpa, access_type type, access_type trap_ty
int maxgpabits = vm.levels * vm.idxbits + vm.widenbits + PGSHIFT;
reg_t maxgpa = (1ULL << maxgpabits) - 1;

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

0 comments on commit 1b53bf9

Please sign in to comment.