@@ -890,7 +890,7 @@ mip_proxy_csr_t::mip_proxy_csr_t(processor_t* const proc, const reg_t addr, gene
890890
891891void mip_proxy_csr_t::verify_permissions (insn_t insn, bool write) const {
892892 csr_t::verify_permissions (insn, write);
893- if ((state->csrmap [CSR_HVICTL]->read () & HVICTL_VTI) &&
893+ if (proc-> extension_enabled ( ' H ' ) && (state->csrmap [CSR_HVICTL]->read () & HVICTL_VTI) &&
894894 proc->extension_enabled (' S' ) && state->v )
895895 throw trap_virtual_instruction (insn.bits ()); // VS-mode attempts to access sip when hvictl.VTI=1
896896}
@@ -912,7 +912,7 @@ mie_proxy_csr_t::mie_proxy_csr_t(processor_t* const proc, const reg_t addr, gene
912912
913913void mie_proxy_csr_t::verify_permissions (insn_t insn, bool write) const {
914914 csr_t::verify_permissions (insn, write);
915- if ((state->csrmap [CSR_HVICTL]->read () & HVICTL_VTI) &&
915+ if (proc-> extension_enabled ( ' H ' ) && (state->csrmap [CSR_HVICTL]->read () & HVICTL_VTI) &&
916916 proc->extension_enabled (' S' ) && state->v )
917917 throw trap_virtual_instruction (insn.bits ()); // VS-mode attempts to access sie when hvictl.VTI=1
918918}
@@ -1731,7 +1731,7 @@ void stimecmp_csr_t::verify_permissions(insn_t insn, bool write) const {
17311731
17321732 basic_csr_t::verify_permissions (insn, write);
17331733
1734- if ((state->csrmap [CSR_HVICTL]->read () & HVICTL_VTI) && state->v && write)
1734+ if (proc-> extension_enabled ( ' H ' ) && (state->csrmap [CSR_HVICTL]->read () & HVICTL_VTI) && state->v && write)
17351735 throw trap_virtual_instruction (insn.bits ());
17361736}
17371737
0 commit comments