@@ -890,9 +890,11 @@ 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) &&
894- proc->extension_enabled (' S' ) && state->v )
895- throw trap_virtual_instruction (insn.bits ()); // VS-mode attempts to access sip when hvictl.VTI=1
893+ if (proc->extension_enabled_const (EXT_SSAIA) && proc->extension_enabled (' H' )) {
894+ if ((state->csrmap [CSR_HVICTL]->read () & HVICTL_VTI) &&
895+ proc->extension_enabled (' S' ) && state->v )
896+ throw trap_virtual_instruction (insn.bits ()); // VS-mode attempts to access sip when hvictl.VTI=1
897+ }
896898}
897899
898900reg_t mip_proxy_csr_t::read () const noexcept {
@@ -912,9 +914,11 @@ mie_proxy_csr_t::mie_proxy_csr_t(processor_t* const proc, const reg_t addr, gene
912914
913915void mie_proxy_csr_t::verify_permissions (insn_t insn, bool write) const {
914916 csr_t::verify_permissions (insn, write);
915- if ((state->csrmap [CSR_HVICTL]->read () & HVICTL_VTI) &&
916- proc->extension_enabled (' S' ) && state->v )
917- throw trap_virtual_instruction (insn.bits ()); // VS-mode attempts to access sie when hvictl.VTI=1
917+ if (proc->extension_enabled_const (EXT_SSAIA) && proc->extension_enabled (' H' )) {
918+ if ((state->csrmap [CSR_HVICTL]->read () & HVICTL_VTI) &&
919+ proc->extension_enabled (' S' ) && state->v )
920+ throw trap_virtual_instruction (insn.bits ()); // VS-mode attempts to access sie when hvictl.VTI=1
921+ }
918922}
919923
920924reg_t mie_proxy_csr_t::read () const noexcept {
@@ -1731,8 +1735,10 @@ void stimecmp_csr_t::verify_permissions(insn_t insn, bool write) const {
17311735
17321736 basic_csr_t::verify_permissions (insn, write);
17331737
1734- if ((state->csrmap [CSR_HVICTL]->read () & HVICTL_VTI) && state->v && write)
1735- throw trap_virtual_instruction (insn.bits ());
1738+ if (proc->extension_enabled_const (EXT_SSAIA) && proc->extension_enabled (' H' )) {
1739+ if ((state->csrmap [CSR_HVICTL]->read () & HVICTL_VTI) && state->v && write)
1740+ throw trap_virtual_instruction (insn.bits ());
1741+ }
17361742}
17371743
17381744virtualized_with_special_permission_csr_t ::virtualized_with_special_permission_csr_t (processor_t * const proc, csr_t_p orig, csr_t_p virt):
0 commit comments