@@ -890,7 +890,7 @@ mip_proxy_csr_t::mip_proxy_csr_t(processor_t* const proc, const reg_t addr, gene
890
890
891
891
void mip_proxy_csr_t::verify_permissions (insn_t insn, bool write) const {
892
892
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) &&
894
894
proc->extension_enabled (' S' ) && state->v )
895
895
throw trap_virtual_instruction (insn.bits ()); // VS-mode attempts to access sip when hvictl.VTI=1
896
896
}
@@ -912,7 +912,7 @@ mie_proxy_csr_t::mie_proxy_csr_t(processor_t* const proc, const reg_t addr, gene
912
912
913
913
void mie_proxy_csr_t::verify_permissions (insn_t insn, bool write) const {
914
914
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) &&
916
916
proc->extension_enabled (' S' ) && state->v )
917
917
throw trap_virtual_instruction (insn.bits ()); // VS-mode attempts to access sie when hvictl.VTI=1
918
918
}
@@ -1731,7 +1731,7 @@ void stimecmp_csr_t::verify_permissions(insn_t insn, bool write) const {
1731
1731
1732
1732
basic_csr_t::verify_permissions (insn, write);
1733
1733
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)
1735
1735
throw trap_virtual_instruction (insn.bits ());
1736
1736
}
1737
1737
0 commit comments