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.
.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
* 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