aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomita Moeko <tomitamoeko@gmail.com>2025-05-06 01:03:00 +0800
committerCédric Le Goater <clg@redhat.com>2025-05-09 12:42:27 +0200
commit2bd33abcf16b50de8e71b1db98186d6fa67f9a39 (patch)
tree31416ff410692a9e5abfe6578f157579d2fbc60f
parentc0273e77f2d7aab3312eb557b49332da528ff66b (diff)
downloadqemu-2bd33abcf16b50de8e71b1db98186d6fa67f9a39.zip
qemu-2bd33abcf16b50de8e71b1db98186d6fa67f9a39.tar.gz
qemu-2bd33abcf16b50de8e71b1db98186d6fa67f9a39.tar.bz2
vfio/igd: Check vendor and device ID on GVT-g mdev
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> Reviewed-by: Corvin Köhne <c.koehne@beckhoff.com> Reviewed-by: Alex Williamson <alex.williamson@redhat.com> Tested-by: Alex Williamson <alex.williamson@redhat.com> Link: https://lore.kernel.org/qemu-devel/20250505170305.23622-5-tomitamoeko@gmail.com Signed-off-by: Cédric Le Goater <clg@redhat.com>
-rw-r--r--hw/vfio/igd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c
index 347253d..f5dd475 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) ||