qemu/hw/vfio
Cédric Le Goater d2b668fca5 vfio/pci: Clear MSI-X IRQ index always
When doing device assignment of a physical device, MSI-X can be
enabled with no vectors enabled and this sets the IRQ index to
VFIO_PCI_MSIX_IRQ_INDEX. However, when MSI-X is disabled, the IRQ
index is left untouched if no vectors are in use. Then, when INTx
is enabled, the IRQ index value is considered incompatible (set to
MSI-X) and VFIO_DEVICE_SET_IRQS fails. QEMU complains with :

qemu-system-x86_64: vfio 0000:08:00.0: Failed to set up TRIGGER eventfd signaling for interrupt INTX-0: VFIO_DEVICE_SET_IRQS failure: Invalid argument

To avoid that, unconditionaly clear the IRQ index when MSI-X is
disabled.

Buglink: https://issues.redhat.com/browse/RHEL-21293
Fixes: 5ebffa4e87 ("vfio/pci: use an invalid fd to enable MSI-X")
Cc: Jing Liu <jing2.liu@intel.com>
Cc: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2024-01-29 08:26:25 +01:00
..
amd-xgbe.c
ap.c vfio: Introduce a helper function to initialize VFIODevice 2023-12-19 19:03:38 +01:00
calxeda-xgmac.c
ccw.c vfio: Introduce a helper function to initialize VFIODevice 2023-12-19 19:03:38 +01:00
common.c vfio: use matching sizeof type 2024-01-29 08:26:25 +01:00
container-base.c vfio/container: Introduce a VFIOIOMMU QOM interface 2024-01-05 21:25:20 +01:00
container.c vfio/container: Rename vfio_init_container to vfio_set_iommu 2024-01-05 21:25:20 +01:00
display.c hw/vfio: Constify VMState 2023-12-30 07:38:06 +11:00
helpers.c vfio: Introduce a helper function to initialize VFIODevice 2023-12-19 19:03:38 +01:00
igd.c *: Add missing includes of qemu/error-report.h 2023-03-22 15:06:57 +00:00
iommufd.c vfio/iommufd: Remove the use of stat() to check file existence 2024-01-05 21:25:20 +01:00
Kconfig
meson.build vfio/spapr: Only compile sPAPR IOMMU support when needed 2024-01-05 21:25:20 +01:00
migration.c vfio/migration: Add helper function to set state or reset device 2024-01-05 21:25:20 +01:00
pci-quirks.c spapr: Remove support for NVIDIA V100 GPU with NVLink2 2023-09-18 07:25:28 -03:00
pci.c vfio/pci: Clear MSI-X IRQ index always 2024-01-29 08:26:25 +01:00
pci.h vfio/pci: Introduce a vfio pci hot reset interface 2023-12-19 19:03:38 +01:00
platform.c vfio: Introduce a helper function to initialize VFIODevice 2023-12-19 19:03:38 +01:00
spapr.c vfio/spapr: Introduce a sPAPR VFIOIOMMU QOM interface 2024-01-05 21:25:20 +01:00
trace-events vfio/iommufd: Enable pci hot reset through iommufd cdev interface 2023-12-19 19:03:38 +01:00
trace.h