qemu/hw/vfio
Tomita Moeko 5aed8b0f0b vfio/igd: Remove GTT write quirk in IO BAR 4
The IO BAR4 of IGD devices contains a pair of 32-bit address/data
registers, MMIO_Index (0x0) and MMIO_Data (0x4), which provide access
to the MMIO BAR0 (GTTMMADR) from IO space. These registers are probably
only used by the VBIOS, and are not documented by intel. The observed
layout of MMIO_Index register is:
 31                                                   2   1      0
+-------------------------------------------------------------------+
|                        Offset                        | Rsvd | Sel |
+-------------------------------------------------------------------+
- Offset: Byte offset in specified region, 4-byte aligned.
- Sel: Region selector
       0: MMIO register region (first half of MMIO BAR0)
       1: GTT region (second half of MMIO BAR0). Pre Gen11 only.

Currently, QEMU implements a quirk that adjusts the guest Data Stolen
Memory (DSM) region address to be (addr - host BDSM + guest BDSM) when
programming GTT entries via IO BAR4, assuming guest still programs GTT
with host DSM address, which is not the case. Guest's BDSM register is
emulated and initialized to 0 at startup by QEMU, then SeaBIOS programs
its value[1]. As result, the address programmed to GTT entries by VBIOS
running in guest are valid GPA, and this unnecessary adjustment brings
inconsistency.

[1] https://gitlab.com/qemu-project/seabios/-/blob/1.12-stable/src/fw/pciinit.c#L319-332

Signed-off-by: Tomita Moeko <tomitamoeko@gmail.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Tested-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Corvin Köhne <c.koehne@beckhoff.com>
Link: https://lore.kernel.org/qemu-devel/20250306180131.32970-2-tomitamoeko@gmail.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
2025-03-11 17:01:14 +01:00
..
amd-xgbe.c vfio-platform: Deprecate all forms of vfio-platform devices 2025-03-06 06:47:33 +01:00
ap.c vfio: Add property documentation 2025-03-06 06:47:33 +01:00
calxeda-xgmac.c vfio-platform: Deprecate all forms of vfio-platform devices 2025-03-06 06:47:33 +01:00
ccw.c vfio/ccw: Replace warn_once_pfch() with warn_report_once() 2025-03-06 06:47:33 +01:00
common.c virtio,pc,pci: features, fixes, cleanups 2025-02-22 05:06:39 +08:00
container-base.c vfio/container: Add dirty tracking started flag 2024-12-26 07:23:38 +01:00
container.c vfio: Remove reports of DMA mapping errors in backends 2025-02-11 14:15:19 +01:00
cpr.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
display.c vfio/display: Fix vfio_display_edid_init() error path 2024-07-09 11:50:37 +02:00
helpers.c vfio: Introduce vfio_get_vfio_device() 2025-02-11 14:15:19 +01:00
igd.c vfio/igd: Remove GTT write quirk in IO BAR 4 2025-03-11 17:01:14 +01:00
iommufd.c vfio/iommufd: Fix SIGSEV in iommufd_cdev_attach() 2025-02-11 14:15:19 +01:00
Kconfig hw/vfio: Move the IGD quirk code to a separate file 2020-02-06 11:55:42 -07:00
meson.build vfio/migration: Multifd device state transfer support - basic types 2025-03-06 06:47:34 +01:00
migration-multifd.c vfio/migration: Make x-migration-multifd-transfer VFIO property mutable 2025-03-06 06:47:34 +01:00
migration-multifd.h vfio/migration: Multifd device state transfer support - send side 2025-03-06 06:47:34 +01:00
migration.c vfio/migration: Multifd device state transfer support - send side 2025-03-06 06:47:34 +01:00
pci-quirks.c qdev: Change values of PropertyInfo member @type to be QAPI types 2025-03-06 10:33:05 +01:00
pci-quirks.h vfio/pci: introduce config_offset field in VFIOConfigMirrorQuirk 2025-02-11 14:15:19 +01:00
pci.c vfio/migration: Make x-migration-multifd-transfer VFIO property mutable 2025-03-06 06:47:34 +01:00
pci.h vfio/pci: Delete local pm_cap 2025-03-06 06:47:33 +01:00
platform.c vfio-platform: Deprecate all forms of vfio-platform devices 2025-03-06 06:47:33 +01:00
spapr.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
trace-events vfio/migration: Multifd device state transfer support - send side 2025-03-06 06:47:34 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00