Browse Source

Don't make MPRV load/store virtual if MPV=1, MPP=3 (#666)

* Don't make MPRV load/store virtual if MPV=1, MPP=3

* Use PRV_M instead of the value "3"
pull/670/head
jameshippisley 6 years ago
committed by GitHub
parent
commit
53d94b12bd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      riscv/mmu.cc

2
riscv/mmu.cc

@ -59,7 +59,7 @@ reg_t mmu_t::translate(reg_t addr, reg_t len, access_type type, uint32_t xlate_f
if (type != FETCH) {
if (!proc->state.debug_mode && get_field(proc->state.mstatus, MSTATUS_MPRV)) {
mode = get_field(proc->state.mstatus, MSTATUS_MPP);
if (get_field(proc->state.mstatus, MSTATUS_MPV))
if (get_field(proc->state.mstatus, MSTATUS_MPV) && mode != PRV_M)
virt = true;
}
if (!proc->state.debug_mode && (xlate_flags & RISCV_XLATE_VIRT)) {

Loading…
Cancel
Save