KVM: SVM: remove unnecessary check on INIT intercept
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 19 Aug 2022 16:56:43 +0000 (12:56 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 26 Sep 2022 16:02:28 +0000 (12:02 -0400)
Since svm_check_nested_events() is now handling INIT signals, there is
no need to latch it until the VMEXIT is injected.  The only condition
under which INIT signals are latched is GIF=0.

Suggested-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20220819165643.83692-1-pbonzini@redhat.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/svm.c

index f3813db..26a3483 100644 (file)
@@ -4697,15 +4697,7 @@ static bool svm_apic_init_signal_blocked(struct kvm_vcpu *vcpu)
 {
        struct vcpu_svm *svm = to_svm(vcpu);
 
-       /*
-        * TODO: Last condition latch INIT signals on vCPU when
-        * vCPU is in guest-mode and vmcb12 defines intercept on INIT.
-        * To properly emulate the INIT intercept,
-        * svm_check_nested_events() should call nested_svm_vmexit()
-        * if an INIT signal is pending.
-        */
-       return !gif_set(svm) ||
-                  (vmcb_is_intercept(&svm->vmcb->control, INTERCEPT_INIT));
+       return !gif_set(svm);
 }
 
 static void svm_vcpu_deliver_sipi_vector(struct kvm_vcpu *vcpu, u8 vector)