qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cai Huoqing <cai.huoqing@linux.dev>
To: alex.williamson@redhat.com
Cc: Cai Huoqing <cai.huoqing@linux.dev>, qemu-devel@nongnu.org
Subject: [PATCH] vfio/pci: Don't setup VFIO MSI-X for Kunlun VF
Date: Tue, 14 Dec 2021 13:45:34 +0800	[thread overview]
Message-ID: <20211214054534.6633-1-cai.huoqing@linux.dev> (raw)

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



             reply	other threads:[~2021-12-14 14:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14  5:45 Cai Huoqing [this message]
2021-12-21 19:16 ` [PATCH] vfio/pci: Don't setup VFIO MSI-X for Kunlun VF Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211214054534.6633-1-cai.huoqing@linux.dev \
    --to=cai.huoqing@linux.dev \
    --cc=alex.williamson@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).