[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 4/9] vfio/igd: Check vendor and device ID on GVT-g mdev
From: |
Tomita Moeko |
Subject: |
[PATCH v3 4/9] vfio/igd: Check vendor and device ID on GVT-g mdev |
Date: |
Tue, 6 May 2025 01:03:00 +0800 |
Check the vendor and device ID on GVT-g mdev to ensure it is a supported
device [1]. This extra check is required for automatically enabling
OpRegion access later.
Note that Cherryview and Gemini Lake are marked as supported here since
current code cannot distinguish them with other Gen8 and Gen9 devices.
Since mdev cannot be created on these devices, this has no functional
impact.
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/i915/intel_gvt.c?h=v6.14#n52
Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
---
hw/vfio/igd.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c
index 347253d08c..f5dd475028 100644
--- a/hw/vfio/igd.c
+++ b/hw/vfio/igd.c
@@ -672,6 +672,18 @@ error:
static bool vfio_pci_kvmgt_config_quirk(VFIOPCIDevice *vdev, Error **errp)
{
g_autofree struct vfio_region_info *opregion = NULL;
+ int gen;
+
+ if (!vfio_pci_is(vdev, PCI_VENDOR_ID_INTEL, PCI_ANY_ID) ||
+ !vfio_is_vga(vdev)) {
+ return true;
+ }
+
+ /* FIXME: Cherryview is Gen8, but don't support GVT-g */
+ gen = igd_gen(vdev);
+ if (gen != 8 && gen != 9) {
+ return true;
+ }
if ((vdev->features & VFIO_FEATURE_ENABLE_IGD_OPREGION) &&
(!vfio_pci_igd_opregion_detect(vdev, &opregion, errp) ||
--
2.47.2
- [PATCH v3 0/9] vfio/igd: Detect IGD by OpRegion and enable OpRegion automatically, Tomita Moeko, 2025/05/05
- [PATCH v3 3/9] vfio/igd: Detect IGD device by OpRegion, Tomita Moeko, 2025/05/05
- [PATCH v3 1/9] vfio/igd: Restrict legacy mode to Gen6-9 devices, Tomita Moeko, 2025/05/05
- [PATCH v3 4/9] vfio/igd: Check vendor and device ID on GVT-g mdev,
Tomita Moeko <=
- [PATCH v3 2/9] vfio/igd: Always emulate ASLS (OpRegion) register, Tomita Moeko, 2025/05/05
- [PATCH v3 5/9] vfio/igd: Check OpRegion support on GVT-g mdev, Tomita Moeko, 2025/05/05
- [PATCH v3 7/9] vfio/igd: Allow overriding GMS with 0xf0 to 0xfe on Gen9+, Tomita Moeko, 2025/05/05
- [PATCH v3 6/9] vfio/igd: Enable OpRegion by default, Tomita Moeko, 2025/05/05
- [PATCH v3 8/9] vfio/igd: Only emulate GGC register when x-igd-gms is set, Tomita Moeko, 2025/05/05
- [PATCH v3 9/9] vfio/igd: Remove generation limitation for IGD passthrough, Tomita Moeko, 2025/05/05
- Re: [PATCH v3 0/9] vfio/igd: Detect IGD by OpRegion and enable OpRegion automatically, Cédric Le Goater, 2025/05/05
- Re: [PATCH v3 0/9] vfio/igd: Detect IGD by OpRegion and enable OpRegion automatically, Cédric Le Goater, 2025/05/06