Skip to content

Commit cd86240

Browse files
committed
KVM: SVM: WARN if updating IRTE GA fields in IOMMU fails
WARN if updating GA information for an IRTE entry fails as modifying an IRTE should only fail if KVM is buggy, e.g. has stale metadata, and because returning an error that is always ignored is pointless. Link: https://lore.kernel.org/r/20250611224604.313496-50-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 48f79c6 commit cd86240

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

arch/x86/kvm/svm/avic.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -835,9 +835,8 @@ int avic_pi_update_irte(struct kvm_kernel_irqfd *irqfd, struct kvm *kvm,
835835
return irq_set_vcpu_affinity(host_irq, NULL);
836836
}
837837

838-
static inline int avic_update_iommu_vcpu_affinity(struct kvm_vcpu *vcpu, int cpu)
838+
static void avic_update_iommu_vcpu_affinity(struct kvm_vcpu *vcpu, int cpu)
839839
{
840-
int ret = 0;
841840
struct vcpu_svm *svm = to_svm(vcpu);
842841
struct kvm_kernel_irqfd *irqfd;
843842

@@ -848,12 +847,10 @@ static inline int avic_update_iommu_vcpu_affinity(struct kvm_vcpu *vcpu, int cpu
848847
* interrupt remapping table entry targeting this vcpu.
849848
*/
850849
if (list_empty(&svm->ir_list))
851-
return 0;
850+
return;
852851

853852
list_for_each_entry(irqfd, &svm->ir_list, vcpu_list)
854-
ret = amd_iommu_update_ga(cpu, irqfd->irq_bypass_data);
855-
856-
return ret;
853+
WARN_ON_ONCE(amd_iommu_update_ga(cpu, irqfd->irq_bypass_data));
857854
}
858855

859856
void avic_vcpu_load(struct kvm_vcpu *vcpu, int cpu)

0 commit comments

Comments
 (0)