vfio/pci: Don't setup VFIO MSI-X for Kunlun VF
PATCH 1/1 vfio/pci: Don't setup VFIO MSI-X for Kunlun VF
No support MSI-X in BAIDU KUNLUN Virtual Function devices, so add a quirk to avoid setuping VFIO MSI-X
Signed-off-by Cai Huoqing <[email protected]>
--- hw/vfio/pci.c | 7 +++++++ 1 file changed, 7 insertions(+)
hw/vfio/pci.c +7 -0
@@ -1994,6 +1994,13 @@ static int vfio_add_std_cap(VFIOPCIDevice *vdev, uint8_t pos, Error **errp) ret =vfio_setup_pcie_cap (vdev, pos, size, errp);break ;case PCI_CAP_ID_MSIX : +/* +* BAIDU KUNLUN Virtual Function devices for KUNLUN AI processor +* don't support MSI-X, so don't setup VFIO MSI-X here. +*/ +if (vdev->vendor_id ==PCI_VENDOR_ID_BAIDU && + vdev->device_id ==PCI_DEVICE_ID_KUNLUN_VF ) +break ; ret =vfio_msix_setup (vdev, pos, errp);break ;case PCI_CAP_ID_PM :
Signature · 1 line
2.25.1
Quoted 16 lines · On Tue, 14 Dec 2021 13:45:34 +0800 Cai Huoqing <[email protected]> wrote:
No support MSI-X in BAIDU KUNLUN Virtual Function devices, so add a quirk to avoid setuping VFIO MSI-X
Signed-off-by Cai Huoqing <[email protected]>--- hw/vfio/pci.c | 7 +++++++ 1 file changed, 7 insertions(+)hw/vfio/pci.c +0
-0@@ -1994,6 +1994,13 @@ static int vfio_add_std_cap(VFIOPCIDevice *vdev, uint8_t pos, Error **errp) ret =vfio_setup_pcie_cap (vdev, pos, size, errp);break ;case PCI_CAP_ID_MSIX :
hw/vfio/pci.c static int vfio_add_std_cap(VFIOPCIDevice *vdev, uint8_t pos, Error **errp) · line 2006
Quoted 10 lines
hw/vfio/pci.c +7
-0+/* +* BAIDU KUNLUN Virtual Function devices for KUNLUN AI processor +* don't support MSI-X, so don't setup VFIO MSI-X here. +*/ +if (vdev->vendor_id ==PCI_VENDOR_ID_BAIDU && + vdev->device_id ==PCI_DEVICE_ID_KUNLUN_VF ) +break ; ret =vfio_msix_setup (vdev, pos, errp);break ;case PCI_CAP_ID_PM :
So the VF exposes an MSI-X capability but it's entirely unsupported and/or bogus? If it's not bogus, why can't we support it? How does the host kernel driver know to avoid MSI-X? Should we use the same mechanism used by the host driver to quirk whether vfio-pci exposes the MSI-X capability to userspace at all? Thanks,
Alex