aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--riscv/insns/wfi.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/riscv/insns/wfi.h b/riscv/insns/wfi.h
index 3411da0..5382072 100644
--- a/riscv/insns/wfi.h
+++ b/riscv/insns/wfi.h
@@ -1,9 +1,7 @@
-if (STATE.v && STATE.prv == PRV_U) {
- require_novirt();
-} else if (get_field(STATE.mstatus->read(), MSTATUS_TW)) {
+if (get_field(STATE.mstatus->read(), MSTATUS_TW)) {
require_privilege(PRV_M);
-} else if (STATE.v) { // VS-mode
- if (get_field(STATE.hstatus->read(), HSTATUS_VTW))
+} else if (STATE.v) {
+ if (STATE.prv == PRV_U || get_field(STATE.hstatus->read(), HSTATUS_VTW))
require_novirt();
} else if (p->extension_enabled('S')) {
// When S-mode is implemented, then executing WFI in