aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/insns')
-rw-r--r--riscv/insns/mret.h2
-rw-r--r--riscv/insns/sret.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/riscv/insns/mret.h b/riscv/insns/mret.h
index 1133e86..6d4d59f 100644
--- a/riscv/insns/mret.h
+++ b/riscv/insns/mret.h
@@ -11,8 +11,8 @@ s = set_field(s, MSTATUS_MPP, p->extension_enabled('U') ? PRV_U : PRV_M);
s = set_field(s, MSTATUS_MPV, 0);
if (ZICFILP_xLPE(prev_virt, prev_prv)) {
STATE.elp = static_cast<elp_t>(get_field(s, MSTATUS_MPELP));
- s = set_field(s, MSTATUS_MPELP, elp_t::NO_LP_EXPECTED);
}
+s = set_field(s, MSTATUS_MPELP, elp_t::NO_LP_EXPECTED);
STATE.mstatus->write(s);
if (STATE.mstatush) STATE.mstatush->write(s >> 32); // log mstatush change
p->set_privilege(prev_prv, prev_virt);
diff --git a/riscv/insns/sret.h b/riscv/insns/sret.h
index aeaf087..23a13b5 100644
--- a/riscv/insns/sret.h
+++ b/riscv/insns/sret.h
@@ -25,7 +25,7 @@ if (!STATE.v) {
}
if (ZICFILP_xLPE(prev_virt, prev_prv)) {
STATE.elp = static_cast<elp_t>(get_field(s, SSTATUS_SPELP));
- s = set_field(s, SSTATUS_SPELP, elp_t::NO_LP_EXPECTED);
}
+s = set_field(s, SSTATUS_SPELP, elp_t::NO_LP_EXPECTED);
STATE.sstatus->write(s);
p->set_privilege(prev_prv, prev_virt);