diff options
author | Sean Christopherson <seanjc@google.com> | 2025-06-11 15:45:33 -0700 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2025-06-23 09:50:31 -0700 |
commit | 803928483669b41e84c27086ffcf28438c1a8cca (patch) | |
tree | 66dd1a042e14e0d3e7b25cf18c50afc427423faf | |
parent | c5af31698d719acf35ec3e3a3610a7c92dac0e6e (diff) |
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>
-rw-r--r-- | arch/x86/kvm/svm/avic.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c index b0f41ae631bb..eed5c58ac07f 100644 --- a/arch/x86/kvm/svm/avic.c +++ b/arch/x86/kvm/svm/avic.c @@ -808,8 +808,6 @@ int avic_pi_update_irte(struct kvm_kernel_irqfd *irqfd, struct kvm *kvm, unsigned int host_irq, uint32_t guest_irq, struct kvm_vcpu *vcpu, u32 vector) { - int ret = 0; - /* * If the IRQ was affined to a different vCPU, remove the IRTE metadata * from the *previous* vCPU's list. @@ -839,8 +837,11 @@ int avic_pi_update_irte(struct kvm_kernel_irqfd *irqfd, struct kvm *kvm, .is_guest_mode = true, .vcpu_data = &vcpu_info, }; + int ret; ret = irq_set_vcpu_affinity(host_irq, &pi); + if (ret) + return ret; /** * 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, * we can reference to them directly when we update vcpu * scheduling information in IOMMU irte. */ - if (!ret) - ret = svm_ir_list_add(to_svm(vcpu), irqfd, &pi); - } else { - ret = irq_set_vcpu_affinity(host_irq, NULL); + return svm_ir_list_add(to_svm(vcpu), irqfd, &pi); } - - if (ret < 0) { - pr_err("%s: failed to update PI IRTE\n", __func__); - goto out; - } - - ret = 0; -out: - return ret; + return irq_set_vcpu_affinity(host_irq, NULL); } static inline int |