qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Tomita Moeko <tomitamoeko@gmail.com>
To: "Alex Williamson" <alex.williamson@redhat.com>,
	"Cédric Le Goater" <clg@redhat.com>
Cc: qemu-devel@nongnu.org, Tomita Moeko <tomitamoeko@gmail.com>
Subject: [PATCH 08/10] vfio/pci: Add placeholder for device-specific config space quirks
Date: Tue, 25 Feb 2025 02:29:25 +0800	[thread overview]
Message-ID: <20250224182927.31519-9-tomitamoeko@gmail.com> (raw)
In-Reply-To: <20250224182927.31519-1-tomitamoeko@gmail.com>

IGD devices require device-specific quirk to be applied to their PCI
config space. Currently, it is put in the BAR4 quirk that does nothing
to BAR4 itself. Add a placeholder for PCI config space quirks to hold
that quirk later.

Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
---
 hw/vfio/pci-quirks.c | 5 +++++
 hw/vfio/pci.c        | 4 ++++
 hw/vfio/pci.h        | 1 +
 3 files changed, 10 insertions(+)

diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c
index cac0aa1910..8a81c60400 100644
--- a/hw/vfio/pci-quirks.c
+++ b/hw/vfio/pci-quirks.c
@@ -1117,6 +1117,11 @@ static void vfio_probe_rtl8168_bar2_quirk(VFIOPCIDevice *vdev, int nr)
 /*
  * Common quirk probe entry points.
  */
+bool vfio_config_quirk_setup(VFIOPCIDevice *vdev, Error **errp)
+{
+    return true;
+}
+
 void vfio_vga_quirk_setup(VFIOPCIDevice *vdev)
 {
     vfio_vga_probe_ati_3c3_quirk(vdev);
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 56d7097a7a..10f63d4589 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3124,6 +3124,10 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
         goto out_unset_idev;
     }
 
+    if (!vfio_config_quirk_setup(vdev, errp)) {
+        goto out_unset_idev;
+    }
+
     if (vdev->vga) {
         vfio_vga_quirk_setup(vdev);
     }
diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
index ca7c0415f0..5570f08f4f 100644
--- a/hw/vfio/pci.h
+++ b/hw/vfio/pci.h
@@ -205,6 +205,7 @@ uint64_t vfio_vga_read(void *opaque, hwaddr addr, unsigned size);
 void vfio_vga_write(void *opaque, hwaddr addr, uint64_t data, unsigned size);
 
 bool vfio_opt_rom_in_denylist(VFIOPCIDevice *vdev);
+bool vfio_config_quirk_setup(VFIOPCIDevice *vdev, Error **errp);
 void vfio_vga_quirk_setup(VFIOPCIDevice *vdev);
 void vfio_vga_quirk_exit(VFIOPCIDevice *vdev);
 void vfio_vga_quirk_finalize(VFIOPCIDevice *vdev);
-- 
2.47.2



  parent reply	other threads:[~2025-02-24 18:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24 18:29 [PATCH 00/10] vfio/igd: Remove legacy mode Tomita Moeko
2025-02-24 18:29 ` [PATCH 01/10] vfio/igd: Remove GTT write quirk in IO BAR 4 Tomita Moeko
2025-02-24 18:29 ` [PATCH 02/10] vfio/igd: Do not include GTT stolen size in etc/igd-bdsm-size Tomita Moeko
2025-02-24 18:29 ` [PATCH 03/10] vfio/igd: Remove rombar check for legacy mode Tomita Moeko
2025-02-24 18:29 ` [PATCH 04/10] vfio/igd: Remove implicit VGA access enabled by " Tomita Moeko
2025-02-24 18:29 ` [PATCH 05/10] vfio/pci: Make vfio_populate_vga static Tomita Moeko
2025-02-24 18:29 ` [PATCH 06/10] vfio/igd: Consolidate OpRegion initialization into a single function Tomita Moeko
2025-02-24 18:29 ` [PATCH 07/10] vfio/igd: Move LPC bridge initialization to a separate function Tomita Moeko
2025-02-24 18:29 ` Tomita Moeko [this message]
2025-02-24 18:29 ` [PATCH 09/10] vfio/igd: Refactor vfio_probe_igd_bar4_quirk into pci config quirk Tomita Moeko
2025-02-24 18:29 ` [PATCH 10/10] vfio/igd: Replace legacy mode with options Tomita Moeko
2025-02-27  8:28 ` [PATCH 00/10] vfio/igd: Remove legacy mode Cédric Le Goater
2025-02-27 16:03   ` Tomita Moeko
2025-02-27 21:55 ` 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=20250224182927.31519-9-tomitamoeko@gmail.com \
    --to=tomitamoeko@gmail.com \
    --cc=alex.williamson@redhat.com \
    --cc=clg@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).