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: 5ebffa4e87e7 ("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
..
2024-01-26 12:23:04 +00:00
2023-12-31 09:11:28 +01:00
2024-01-20 17:22:16 +00:00
2023-12-29 11:17:30 +11:00
2024-01-11 15:19:14 +00:00
2023-12-29 11:17:30 +11:00
2023-12-29 11:17:30 +11:00
2023-12-29 11:17:30 +11:00
2023-12-31 09:11:28 +01:00
2023-12-30 07:38:06 +11:00
2023-12-30 07:38:06 +11:00
2024-01-20 17:22:16 +00:00
2023-12-30 07:38:06 +11:00
2023-12-30 07:38:06 +11:00
2023-12-31 09:11:28 +01:00
2024-01-05 16:20:15 +01:00
2023-12-30 07:38:06 +11:00
2023-12-30 07:38:06 +11:00
2024-01-05 13:35:25 +00:00
2023-12-30 07:38:06 +11:00