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

From: Reinette Chatre
Date: Tue Apr 04 2023 - 16:46:22 EST


Hi Alex,

On 4/4/2023 11:43 AM, Alex Williamson wrote:
>
> I think Kevin has a point, if it's correct that we do this get/write in
> order to account for manipulation of the device since we wrote into the
> vector table via either pci_alloc_irq_vectors() or
> pci_msix_alloc_irq_at(), then it really only makes sense to do that
> restore if we haven't allocated the irq and written the vector table
> immediately prior. Thanks,
>

I see. Even so, could it be acceptable to call get_cached_msi_msg()/pci_write_msi_msg()
unconditionally (for MSI-X) or should the new [1] vfio_pci_alloc_irq()
indicate if a new IRQ was allocated to determine if
get_cached_msi_msg()/pci_write_msi_msg() should be run?

Reinette


[1] https://lore.kernel.org/lkml/20230403211841.0e206b67.alex.williamson@xxxxxxxxxx/