All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vfio/pci: Don't setup VFIO MSI-X for Kunlun VF
@ 2021-12-14  5:45 Cai Huoqing
  2021-12-21 19:16 ` Alex Williamson
  0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2021-12-14  5:45 UTC (permalink / raw)
  To: alex.williamson; +Cc: Cai Huoqing, qemu-devel

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.huoqing@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:
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] vfio/pci: Don't setup VFIO MSI-X for Kunlun VF
  2021-12-14  5:45 [PATCH] vfio/pci: Don't setup VFIO MSI-X for Kunlun VF Cai Huoqing
@ 2021-12-21 19:16 ` Alex Williamson
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Williamson @ 2021-12-21 19:16 UTC (permalink / raw)
  To: Cai Huoqing; +Cc: qemu-devel

On Tue, 14 Dec 2021 13:45:34 +0800
Cai Huoqing <cai.huoqing@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.huoqing@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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-21 19:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14  5:45 [PATCH] vfio/pci: Don't setup VFIO MSI-X for Kunlun VF Cai Huoqing
2021-12-21 19:16 ` Alex Williamson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.