diff mbox series

[03/10] vfio/igd: Remove rombar check for legacy mode

Message ID 20250224182927.31519-4-tomitamoeko@gmail.com (mailing list archive)
State New
Headers show
Series vfio/igd: Remove legacy mode | expand

Commit Message

Tomita Moeko Feb. 24, 2025, 6:29 p.m. UTC
Legacy VBIOS support was removed in Gen 11 and later IGD devices. While
we usually uses romfile for IGD-related DXE drivers, it's not always
necessary. Remove the ROM BAR requirement for legacy mode to support
newer devices without a specified romfile.

Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
---
 hw/vfio/igd.c | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c
index dda4c7bb5d..4ae1122a2d 100644
--- a/hw/vfio/igd.c
+++ b/hw/vfio/igd.c
@@ -341,7 +341,6 @@  void vfio_probe_igd_bar0_quirk(VFIOPCIDevice *vdev, int nr)
 
 void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr)
 {
-    g_autofree struct vfio_region_info *rom = NULL;
     g_autofree struct vfio_region_info *opregion = NULL;
     g_autofree struct vfio_region_info *host = NULL;
     g_autofree struct vfio_region_info *lpc = NULL;
@@ -391,26 +390,12 @@  void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr)
     }
 
     /*
-     * Most of what we're doing here is to enable the ROM to run, so if
-     * there's no ROM, there's no point in setting up this quirk.
-     * NB. We only seem to get BIOS ROMs, so a UEFI VM would need CSM support.
-     */
-    ret = vfio_get_region_info(&vdev->vbasedev,
-                               VFIO_PCI_ROM_REGION_INDEX, &rom);
-    if ((ret || !rom->size) && !vdev->pdev.romfile) {
-        error_report("IGD device %s has no ROM, legacy mode disabled",
-                     vdev->vbasedev.name);
-        return;
-    }
-
-    /*
-     * Ignore the hotplug corner case, mark the ROM failed, we can't
-     * create the devices we need for legacy mode in the hotplug scenario.
+     * Ignore the hotplug corner case, we can't create the devices we
+     * need for legacy mode in the hotplug scenario.
      */
     if (vdev->pdev.qdev.hotplugged) {
-        error_report("IGD device %s hotplugged, ROM disabled, "
-                     "legacy mode disabled", vdev->vbasedev.name);
-        vdev->rom_read_failed = true;
+        error_report("IGD device %s hotplugged, legacy mode disabled",
+                     vdev->vbasedev.name);
         return;
     }