Skip to content

vfio/igd: Detect IGD by OpRegion and enable OpRegion automatically

Tomita Moeko qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11vfio/igd: Restrict legacy mode to Gen6-9 deviceshw/vfio/igd.c+5 -11 reply
2/11vfio/igd: Always emulate ASLS (OpRegion) registerhw/vfio/igd.c+9 -50 replies
3/11vfio/igd: Detect IGD device by OpRegionhw/vfio/igd.c+18 -83 replies
4/11vfio/igd: Remove vfio_pci_igd_setup_opregionhw/vfio/igd.c+21 -290 replies
5/11vfio/igd: Check vendor and device ID on GVT-g mdevhw/vfio/igd.c+13 -00 replies
6/11vfio/igd: Enable OpRegion by defaulthw/vfio/pci.c+1 -10 replies
7/11vfio/igd: Allow hotplugging with OpRegion enabledhw/vfio/igd.c+0 -42 replies
8/11vfio/igd: Allow overriding GMS with 0xf0 to 0xfe on Gen9+hw/vfio/igd.c+41 -181 reply
9/11vfio/igd: Only emulate GGC register when x-igd-gms is sethw/vfio/igd.c+26 -230 replies
10/11vfio/igd: Remove generation limitation for IGD passthroughhw/vfio/igd.c+21 -371 reply
11/11vfio/igd: Update IGD passthrough documentationdocs/igd-assign.txt+9 -21 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/11] vfio/igd: Detect IGD by OpRegion and enable OpRegion automatically

As proposed in a previous discussion [1], detect IGD devices based on whether it has VFIO_REGION_SUBTYPE_INTEL_IGD_OPREGION exposed by kernel and enables OpRegion access by default. This enables out-of-the-box display output support for IGD passthrough without having to manually set x-igd-opregion=on, which probably saves effort for libvirt users.

This patchset also limits legacy mode to Gen6-9 devices, as Intel no longer provides CSM support and VBIOS on newer IGD, and Seabios does not support setting up the 64 bit BDSM register on Gen 11+ devices. Exposing VGA ranges to guests by default on platforms without VGA mode support is undesirable.

Additionally, as we enables OpRegion on IGD devices by default, and Intel removes the BDSM register from Meteor Lake [2]. There seems to be no extra register quirks rather than OpRegion required on newer devices. To support them (and probably future devices), the generation limit is removed, with BDSM quirk only applied to known Gen 6-12 devices.

Note: I have not been able to test this on Meteor Lake or newer platforms due to lack of hardware.

[1] https://lore.kernel.org/qemu-devel/[email protected]/T/
[2] https://edc.intel.com/content/www/us/en/design/publications/14th-generation-core-processors-cfg-and-mem-registers/d2-f0-processor-graphics-registers/

Tomita Moeko (11):
vfio/igd: Restrict legacy mode to Gen6-9 devices vfio/igd: Always emulate ASLS (OpRegion) register vfio/igd: Detect IGD device by OpRegion vfio/igd: Remove vfio_pci_igd_setup_opregion vfio/igd: Check vendor and device ID on GVT-g mdev vfio/igd: Enable OpRegion by default
vfio/igd: Allow hotplugging with OpRegion enabled vfio/igd: Allow overriding GMS with 0xf0 to 0xfe on Gen9+ vfio/igd: Only emulate GGC register when x-igd-gms is set vfio/igd: Remove generation limitation for IGD passthrough vfio/igd: Update IGD passthrough documentation

 docs/igd-assign.txt |  11 +-
 hw/vfio/igd.c       | 257 ++++++++++++++++++++++++--------------------
 hw/vfio/pci.c       |   2 +-
 3 files changed, 153 insertions(+), 117 deletions(-)
Signature · 1 line
2.47.2