vfio/igd: return an invalid generation for unknown devices
authorCorvin Köhne <corvin.koehne@gmail.com>
Wed, 28 Aug 2024 13:43:22 +0000 (15:43 +0200)
committerCédric Le Goater <clg@redhat.com>
Tue, 17 Sep 2024 08:37:55 +0000 (10:37 +0200)
Intel changes it's specification quite often e.g. the location and size
of the BDSM register has change for gen 11 devices and later. This
causes our emulation to fail on those devices. So, it's impossible for
us to use a suitable default value for unknown devices. Instead of
returning a random generation value and hoping that everthing works
fine, we should verify that different devices are working and add them
to our list of known devices.

Signed-off-by: Corvin Köhne <c.koehne@beckhoff.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
hw/vfio/igd.c

index d320d032a7f3b19df0d055178f6fefe4bdfd8668..650a323ddaac746de780103ca857256709c0e0aa 100644 (file)
@@ -90,7 +90,11 @@ static int igd_gen(VFIOPCIDevice *vdev)
         return 8;
     }
 
-    return 8; /* Assume newer is compatible */
+    /*
+     * Unfortunately, Intel changes it's specification quite often. This makes
+     * it impossible to use a suitable default value for unknown devices.
+     */
+    return -1;
 }
 
 typedef struct VFIOIGDQuirk {