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, "Corvin Köhne" <corvin.koehne@gmail.com>,
"Tomita Moeko" <tomitamoeko@gmail.com>
Subject: [PATCH v3 09/10] vfio/igd: Introduce x-igd-lpc option for LPC bridge ID quirk
Date: Fri, 7 Mar 2025 02:01:29 +0800 [thread overview]
Message-ID: <20250306180131.32970-10-tomitamoeko@gmail.com> (raw)
In-Reply-To: <20250306180131.32970-1-tomitamoeko@gmail.com>
The LPC bridge/Host bridge IDs quirk is also not dependent on legacy
mode. Recent Windows driver no longer depends on these IDs, as well as
Linux i915 driver, while UEFI GOP seems still needs them. Make it an
option to allow users enabling and disabling it as needed.
Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
---
hw/vfio/igd.c | 14 ++++++++------
hw/vfio/pci.c | 2 ++
hw/vfio/pci.h | 3 +++
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c
index 4c3862b61e..6775ce2eac 100644
--- a/hw/vfio/igd.c
+++ b/hw/vfio/igd.c
@@ -560,13 +560,9 @@ bool vfio_probe_igd_config_quirk(VFIOPCIDevice *vdev, Error **errp)
goto error;
}
- /* Enable OpRegion quirk */
+ /* Enable OpRegion and LPC brige quirk */
vdev->features |= VFIO_FEATURE_ENABLE_IGD_OPREGION;
-
- /* Setup LPC bridge / Host bridge PCI IDs */
- if (!vfio_pci_igd_setup_lpc_bridge(vdev, &err)) {
- goto error;
- }
+ vdev->features |= VFIO_FEATURE_ENABLE_IGD_LPC;
} else if (vdev->igd_legacy_mode == ON_OFF_AUTO_ON) {
error_setg(&err,
"Machine is not i440fx or assigned BDF is not 00:02.0");
@@ -579,6 +575,12 @@ bool vfio_probe_igd_config_quirk(VFIOPCIDevice *vdev, Error **errp)
goto error;
}
+ /* Setup LPC bridge / Host bridge PCI IDs */
+ if ((vdev->features & VFIO_FEATURE_ENABLE_IGD_LPC) &&
+ !vfio_pci_igd_setup_lpc_bridge(vdev, errp)) {
+ goto error;
+ }
+
/*
* Allow user to override dsm size using x-igd-gms option, in multiples of
* 32MiB. This option should only be used when the desired size cannot be
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index c9a484fa68..d16cc5cc90 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3354,6 +3354,8 @@ static const Property vfio_pci_dev_properties[] = {
VFIO_FEATURE_ENABLE_REQ_BIT, true),
DEFINE_PROP_BIT("x-igd-opregion", VFIOPCIDevice, features,
VFIO_FEATURE_ENABLE_IGD_OPREGION_BIT, false),
+ DEFINE_PROP_BIT("x-igd-lpc", VFIOPCIDevice, features,
+ VFIO_FEATURE_ENABLE_IGD_LPC_BIT, false),
DEFINE_PROP_ON_OFF_AUTO("x-igd-legacy-mode", VFIOPCIDevice,
igd_legacy_mode, ON_OFF_AUTO_AUTO),
DEFINE_PROP_ON_OFF_AUTO("enable-migration", VFIOPCIDevice,
diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h
index 0d0a18136a..a87333f3d5 100644
--- a/hw/vfio/pci.h
+++ b/hw/vfio/pci.h
@@ -154,6 +154,9 @@ struct VFIOPCIDevice {
#define VFIO_FEATURE_ENABLE_IGD_OPREGION_BIT 2
#define VFIO_FEATURE_ENABLE_IGD_OPREGION \
(1 << VFIO_FEATURE_ENABLE_IGD_OPREGION_BIT)
+#define VFIO_FEATURE_ENABLE_IGD_LPC_BIT 3
+#define VFIO_FEATURE_ENABLE_IGD_LPC \
+ (1 << VFIO_FEATURE_ENABLE_IGD_LPC_BIT)
OnOffAuto display;
uint32_t display_xres;
uint32_t display_yres;
--
2.47.2
next prev parent reply other threads:[~2025-03-06 18:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 18:01 [PATCH v3 00/10] vfio/igd: Decoupling quirks with legacy mode Tomita Moeko
2025-03-06 18:01 ` [PATCH v3 01/10] vfio/igd: Remove GTT write quirk in IO BAR 4 Tomita Moeko
2025-03-06 18:01 ` [PATCH v3 02/10] vfio/igd: Do not include GTT stolen size in etc/igd-bdsm-size Tomita Moeko
2025-03-06 18:01 ` [PATCH v3 03/10] vfio/igd: Consolidate OpRegion initialization into a single function Tomita Moeko
2025-03-06 18:01 ` [PATCH v3 04/10] vfio/igd: Move LPC bridge initialization to a separate function Tomita Moeko
2025-03-06 18:01 ` [PATCH v3 05/10] vfio/pci: Add placeholder for device-specific config space quirks Tomita Moeko
2025-03-06 18:01 ` [PATCH v3 06/10] vfio/igd: Refactor vfio_probe_igd_bar4_quirk into pci config quirk Tomita Moeko
2025-03-06 18:01 ` [PATCH v3 07/10] vfio/igd: Decouple common quirks from legacy mode Tomita Moeko
2025-03-06 22:49 ` Alex Williamson
2025-03-07 18:37 ` Tomita Moeko
2025-03-10 7:13 ` Cédric Le Goater
2025-03-10 8:03 ` Tomita Moeko
2025-03-06 18:01 ` [PATCH v3 08/10] vfio/igd: Handle x-igd-opregion option in config quirk Tomita Moeko
2025-03-06 18:01 ` Tomita Moeko [this message]
2025-03-06 18:01 ` [PATCH v3 10/10] vfio/igd: Fix broken KVMGT OpRegion support Tomita Moeko
2025-03-06 22:49 ` [PATCH v3 00/10] vfio/igd: Decoupling quirks with legacy mode Alex Williamson
2025-03-07 7:17 ` Corvin Köhne
2025-03-07 8:04 ` Cédric Le Goater
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=20250306180131.32970-10-tomitamoeko@gmail.com \
--to=tomitamoeko@gmail.com \
--cc=alex.williamson@redhat.com \
--cc=clg@redhat.com \
--cc=corvin.koehne@gmail.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).