Skip to content

vfio/igd: Decoupling quirks with legacy mode

Tomita Moeko qemu-devel 3 versions – Applied

Status from this message: Applied to vfio-next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest10 patches 7 repliesApplied
  2. v29 patches 6 repliesSuperseded
  3. v110 patches 3 repliesSuperseded

Changes in v3 from the cover letter

* Use OnOffAuto for x-igd-legacy-mode option, default is auto, to keep current behavior.
* Added a new patch to solve the possible KVMGT/GVT-g fail.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/10vfio/igd: Remove GTT write quirk in IO BAR 4hw/vfio/igd.c+1 -1900 replies
2/10vfio/igd: Do not include GTT stolen size in etc/igd-bdsm-sizehw/vfio/igd.c+3 -250 replies
3/10vfio/igd: Consolidate OpRegion initialization into a single functionhw/vfio/igd.c hw/vfio/pci-quirks.c hw/vfio/pci.c +1 more+88 -890 replies
4/10vfio/igd: Move LPC bridge initialization to a separate functionhw/vfio/igd.c+70 -520 replies
5/10vfio/pci: Add placeholder for device-specific config space quirkshw/vfio/pci-quirks.c hw/vfio/pci.c hw/vfio/pci.h+10 -00 replies
6/10vfio/igd: Refactor vfio_probe_igd_bar4_quirk into pci config quirkhw/vfio/igd.c hw/vfio/pci-quirks.c hw/vfio/pci.h+18 -110 replies
7/10vfio/igd: Decouple common quirks from legacy modehw/vfio/igd.c hw/vfio/pci.c hw/vfio/pci.h+77 -534 replies
8/10vfio/igd: Handle x-igd-opregion option in config quirkhw/vfio/igd.c hw/vfio/pci.c hw/vfio/pci.h+9 -160 replies
9/10vfio/igd: Introduce x-igd-lpc option for LPC bridge ID quirkhw/vfio/igd.c hw/vfio/pci.c hw/vfio/pci.h+13 -60 replies
10/10vfio/igd: Fix broken KVMGT OpRegion supporthw/vfio/igd.c+26 -10 replies

Reviews trailers per patch

None of the 10 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAlex WilliamsonCorvin Köhne
SeriesR-b T-b R-b
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/10] vfio/igd: Decoupling quirks with legacy mode

This patchset intends to decouple existing quirks from legacy mode. Currently all quirks depends on legacy mode (except x-igd-opregion), which includes following conditions:
* Machine type is i440fx
* IGD device is at guest BDF 00:02.0
* VBIOS in ROM BAR or file
* VGA IO/MMIO ranges are claimed by IGD
* OpRegion
* Same LPC bridge and Host bridge VID/DID/SVID/SSID as host

If one of the condition is not met, the quirks will not be applied. However, for recent generations, espcially Gen 11+ devices that removed VBIOS support, not all the conditions are required. For example, on EFI- based systems, VBIOS ROM is unnecessary, and VGA ranges are not used.

To have better support on newer UEFI-based VMs, this patchset makes the quirks independent of legacy mode. The BDSM and GGC register quirks are applied to all supported IGD devices, new x-igd-lpc option for the LPC bridge / Host bridge ID quirk is introduced for possible Q35 support. It also prepares for supporting IGD passthrough when it is not primary display later (kernel change will be merged in 6.15).

To maintain backward compatbility with exising configuration, legacy mode will automatically be enabled when:
* Machine type is i440fx
* IGD device is at guest BDF 00:02.0
If the legacy mode behavior is unwanted, option x-igd-legacy-mode=off is provided for users to disable it. Setting x-igd-legacy-mode=on checks if the condition above are met, and set up all the required quirks.

The default value is x-igd-legacy-mode=auto. When the above conditions are all met, it acts as before and continues on any error. Otherwise it is equivalent to x-igd-legacy-mode=off.

When x-igd-legacy-mode is set to on or off, QEMU will fail immediately on error.

The first 2 patches of this patchset was taken from a previous one, details can be found at:
https://lore.kernel.org/all/[email protected]/

This patchest was mainly tested on Alder Lake UHD770, with Debian 12 (kernel 6.1), Windows 11 (driver 32.0.101.6458) and Intel GOP driver 17.0.1081.

Due to I caught COVID these days, I am unable to deliver the proposed documentation update before QEMU 10.0 soft-freeze next week. Please help decide whether to make this patch series in 10.0 or next release.

Changelog:
v3:
* Use OnOffAuto for x-igd-legacy-mode option, default is auto, to keep current behavior.
* Added a new patch to solve the possible KVMGT/GVT-g fail.

v2:
* Keep legacy mode for compatbility
* Renamed from "vfio/igd: Remove legacy mode"

Tomita Moeko (10):
vfio/igd: Remove GTT write quirk in IO BAR 4
vfio/igd: Do not include GTT stolen size in etc/igd-bdsm-size vfio/igd: Consolidate OpRegion initialization into a single function vfio/igd: Move LPC bridge initialization to a separate function vfio/pci: Add placeholder for device-specific config space quirks vfio/igd: Refactor vfio_probe_igd_bar4_quirk into pci config quirk vfio/igd: Decouple common quirks from legacy mode vfio/igd: Handle x-igd-opregion option in config quirk vfio/igd: Introduce x-igd-lpc option for LPC bridge ID quirk vfio/igd: Fix broken KVMGT OpRegion support

 hw/vfio/igd.c        | 529 +++++++++++++++++++------------------------
 hw/vfio/pci-quirks.c |  51 +----
 hw/vfio/pci.c        |  33 +--
 hw/vfio/pci.h        |  11 +-
 4 files changed, 248 insertions(+), 376 deletions(-)
Signature · 1 line
2.47.2