RE: [PATCH V2 7/8] vfio/pci: Support dynamic MSI-x

From: Tian, Kevin
Date: Mon Apr 03 2023 - 23:51:35 EST


> From: Alex Williamson <alex.williamson@xxxxxxxxxx>
> Sent: Tuesday, April 4, 2023 11:19 AM
> >
> > Thank you very much for your guidance. I will digest this some more and
> > see how wrappers could be used. In the mean time while trying to think
> how
> > to unify this code I do think there is an issue in this patch in that
> > the get_cached_msi_msg()/pci_write_msi_msg()
> > should not be in an else branch.
> >
> > Specifically, I think it needs to be:
> > if (msix) {
> > if (irq == -EINVAL) {
> > /* dynamically allocate interrupt */
> > }
> > get_cached_msi_msg(irq, &msg);
> > pci_write_msi_msg(irq, &msg);
> > }
>
> Yes, that's looked wrong to me all along, I think that resolves it.
> Thanks,
>

Do you mind elaborating why this change is required? I thought
pci_msix_alloc_irq_at() will compose a new msi message to write
hence no need to get cached value again in that case...