]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
KVM: SVM: Process all IRTEs on affinity change even if one update fails
authorSean Christopherson <seanjc@google.com>
Wed, 11 Jun 2025 22:45:50 +0000 (15:45 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 23 Jun 2025 16:50:42 +0000 (09:50 -0700)
When updating IRTE GA fields, keep processing all other IRTEs if an update
fails, as not updating later entries risks making a bad situation worse.

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

index 31bf202e0026dc61468c08d53af68c4a0db96649..6ecbd7984975c2dd961b6ce0a187b0987438f840 100644 (file)
@@ -850,12 +850,10 @@ static inline int avic_update_iommu_vcpu_affinity(struct kvm_vcpu *vcpu, int cpu
        if (list_empty(&svm->ir_list))
                return 0;
 
-       list_for_each_entry(irqfd, &svm->ir_list, vcpu_list) {
+       list_for_each_entry(irqfd, &svm->ir_list, vcpu_list)
                ret = amd_iommu_update_ga(cpu, irqfd->irq_bypass_data);
-               if (ret)
-                       return ret;
-       }
-       return 0;
+
+       return ret;
 }
 
 void avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu)