On Tue, 14 Dec 2021 13:45:34 +0800
Cai Huoqing <cai.huoq...@linux.dev> 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 <cai.huoq...@linux.dev>
> ---
>  hw/vfio/pci.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
> index 7b45353ce2..15f76bbe56 100644
> --- a/hw/vfio/pci.c
> +++ b/hw/vfio/pci.c
> @@ -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:


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


Reply via email to