Skip to content

Commit 8039284

Browse files
committed
KVM: SVM: Clean up return handling in avic_pi_update_irte()
Clean up the return paths for avic_pi_update_irte() now that the refactoring dust has settled. Opportunistically drop the pr_err() on IRTE update failures. Logging that a failure occurred without _any_ context is quite useless. Tested-by: Sairaj Kodilkar <sarunkod@amd.com> Link: https://lore.kernel.org/r/20250611224604.313496-32-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent c5af316 commit 8039284

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

arch/x86/kvm/svm/avic.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,6 @@ int avic_pi_update_irte(struct kvm_kernel_irqfd *irqfd, struct kvm *kvm,
808808
unsigned int host_irq, uint32_t guest_irq,
809809
struct kvm_vcpu *vcpu, u32 vector)
810810
{
811-
int ret = 0;
812-
813811
/*
814812
* If the IRQ was affined to a different vCPU, remove the IRTE metadata
815813
* from the *previous* vCPU's list.
@@ -839,8 +837,11 @@ int avic_pi_update_irte(struct kvm_kernel_irqfd *irqfd, struct kvm *kvm,
839837
.is_guest_mode = true,
840838
.vcpu_data = &vcpu_info,
841839
};
840+
int ret;
842841

843842
ret = irq_set_vcpu_affinity(host_irq, &pi);
843+
if (ret)
844+
return ret;
844845

845846
/**
846847
* Here, we successfully setting up vcpu affinity in
@@ -849,20 +850,9 @@ int avic_pi_update_irte(struct kvm_kernel_irqfd *irqfd, struct kvm *kvm,
849850
* we can reference to them directly when we update vcpu
850851
* scheduling information in IOMMU irte.
851852
*/
852-
if (!ret)
853-
ret = svm_ir_list_add(to_svm(vcpu), irqfd, &pi);
854-
} else {
855-
ret = irq_set_vcpu_affinity(host_irq, NULL);
853+
return svm_ir_list_add(to_svm(vcpu), irqfd, &pi);
856854
}
857-
858-
if (ret < 0) {
859-
pr_err("%s: failed to update PI IRTE\n", __func__);
860-
goto out;
861-
}
862-
863-
ret = 0;
864-
out:
865-
return ret;
855+
return irq_set_vcpu_affinity(host_irq, NULL);
866856
}
867857

868858
static inline int

0 commit comments

Comments
 (0)