Skip to content

Commit 50a4aff

Browse files
YenHaoChenbinno
authored andcommitted
AIA: Raise virtual instruction exception on writing stimecmp (stimecmph) from VS-mode when hvictl.VTI=1
1 parent 45166a8 commit 50a4aff

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

riscv/csrs.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,6 +1734,9 @@ void stimecmp_csr_t::verify_permissions(insn_t insn, bool write) const {
17341734
}
17351735

17361736
basic_csr_t::verify_permissions(insn, write);
1737+
1738+
if ((state->csrmap[CSR_HVICTL]->read() & HVICTL_VTI) && state->v && write)
1739+
throw trap_virtual_instruction(insn.bits());
17371740
}
17381741

17391742
void virtualized_with_special_permission_csr_t::verify_permissions(insn_t insn, bool write) const {

0 commit comments

Comments
 (0)