diff mbox series

[04/10] vfio/igd: Remove implicit VGA access enabled by legacy mode

Message ID 20250224182927.31519-5-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
Modern EFI-based system and drivers like i915 no longer use VGA IO/MMIO
registers. Currently, legacy mode checks if the VGA decoding cycle is
claimed by IGD, and implicitly exposes VGA address spaces for device.
As we are going to remove legacy mode, remove this implicit behavior.
If users want to enable VGA access for IGD, use the common x-vga option
explicily.

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

Patch

diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c
index 4ae1122a2d..32ae263c23 100644
--- a/hw/vfio/igd.c
+++ b/hw/vfio/igd.c
@@ -430,20 +430,6 @@  void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr)
         return;
     }
 
-    gmch = vfio_pci_read_config(&vdev->pdev, IGD_GMCH, 4);
-
-    /*
-     * If IGD VGA Disable is clear (expected) and VGA is not already enabled,
-     * try to enable it.  Probably shouldn't be using legacy mode without VGA,
-     * but also no point in us enabling VGA if disabled in hardware.
-     */
-    if (!(gmch & 0x2) && !vdev->vga && !vfio_populate_vga(vdev, &err)) {
-        error_reportf_err(err, VFIO_MSG_PREFIX, vdev->vbasedev.name);
-        error_report("IGD device %s failed to enable VGA access, "
-                     "legacy mode disabled", vdev->vbasedev.name);
-        return;
-    }
-
     /* Create our LPC/ISA bridge */
     ret = vfio_pci_igd_lpc_init(vdev, lpc);
     if (ret) {
@@ -467,6 +453,8 @@  void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr)
         return;
     }
 
+    gmch = vfio_pci_read_config(&vdev->pdev, IGD_GMCH, 4);
+
     /*
      * 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