@@ -8142,6 +8142,7 @@ static int handle_invalid_op(struct kvm_vcpu *vcpu)
static int handle_monitor_trap(struct kvm_vcpu *vcpu)
{
+ kvmi_stop_ss(vcpu);
return 1;
}
@@ -10681,6 +10682,11 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu)
}
}
+ if (kvmi_vcpu_enabled_ss(vcpu)
+ && exit_reason != EXIT_REASON_EPT_VIOLATION
+ && exit_reason != EXIT_REASON_MONITOR_TRAP_FLAG)
+ kvmi_stop_ss(vcpu);
+
if (exit_reason < kvm_vmx_max_exit_handlers
&& kvm_vmx_exit_handlers[exit_reason])
return kvm_vmx_exit_handlers[exit_reason](vcpu);
@@ -7147,8 +7147,7 @@ static int inject_pending_event(struct kvm_vcpu *vcpu, bool req_int_win)
int r;
/* try to reinject previous events if any */
-
- if (vcpu->arch.exception.injected)
+ if (vcpu->arch.exception.injected && !kvmi_vcpu_enabled_ss(vcpu))
kvm_x86_ops->queue_exception(vcpu);
/*
* Do not inject an NMI or interrupt if there is a pending
@@ -7184,7 +7183,7 @@ static int inject_pending_event(struct kvm_vcpu *vcpu, bool req_int_win)
}
/* try to inject new event if pending */
- if (vcpu->arch.exception.pending) {
+ if (vcpu->arch.exception.pending && !kvmi_vcpu_enabled_ss(vcpu)) {
WARN_ON_ONCE(vcpu->arch.exception.injected);
vcpu->arch.exception.pending = false;
vcpu->arch.exception.injected = true;