]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: SVM: Don't check for assigned device(s) when activating AVIC
authorSean Christopherson <seanjc@google.com>
Wed, 11 Jun 2025 22:45:48 +0000 (15:45 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 23 Jun 2025 16:50:41 +0000 (09:50 -0700)
Don't short-circuit IRTE updating when (de)activating AVIC based on the
VM having assigned devices, as nothing prevents AVIC (de)activation from
racing with device (de)assignment.  And from a performance perspective,
bailing early when there is no assigned device doesn't add much, as
ir_list_lock will never be contended if there's no assigned device.

Link: https://lore.kernel.org/r/20250611224604.313496-47-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/avic.c

index e1fa5c73bc98ba30b5ebb7b1ae66dec45d91e799..f3bfd7cb0bca5bb9b9774a38517bc198d1f0ba2c 100644 (file)
@@ -733,9 +733,6 @@ static int avic_set_pi_irte_mode(struct kvm_vcpu *vcpu, bool activate)
        struct vcpu_svm *svm = to_svm(vcpu);
        struct kvm_kernel_irqfd *irqfd;
 
-       if (!kvm_arch_has_assigned_device(vcpu->kvm))
-               return 0;
-
        /*
         * Here, we go through the per-vcpu ir_list to update all existing
         * interrupt remapping table entry targeting this vcpu.