docs/igd-assign.txt | 11 ++- hw/vfio/igd.c | 218 ++++++++++++++++++++++++++------------------ hw/vfio/pci.c | 2 +- 3 files changed, 137 insertions(+), 94 deletions(-)
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/20250325172239.27926-1-tomitamoeko@gmail.com [2] https://edc.intel.com/content/www/us/en/design/publications/14th-generation-core-processors-cfg-and-mem-registers/d2-f0-processor-graphics-registers/ Changelog: v2: * Removed "Allow hotplugging with OpRegion enabled", hotplugging is always forbidden. * Test device is not hotplugged and get opregion in a single function. * Update documentation along with code changes. * Minor code style fixes. Link: https://lore.kernel.org/qemu-devel/20250421163112.21316-1-tomitamoeko@gmail.coms Tomita Moeko (9): 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: Check vendor and device ID on GVT-g mdev vfio/igd: Check OpRegion support on GVT-g mdev vfio/igd: Enable OpRegion by default 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 docs/igd-assign.txt | 11 ++- hw/vfio/igd.c | 218 ++++++++++++++++++++++++++------------------ hw/vfio/pci.c | 2 +- 3 files changed, 137 insertions(+), 94 deletions(-) -- 2.47.2
On Tue, 29 Apr 2025 00:09:55 +0800 Tomita Moeko <tomitamoeko@gmail.com> wrote: > 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/20250325172239.27926-1-tomitamoeko@gmail.com > [2] https://edc.intel.com/content/www/us/en/design/publications/14th-generation-core-processors-cfg-and-mem-registers/d2-f0-processor-graphics-registers/ > > Changelog: > v2: > * Removed "Allow hotplugging with OpRegion enabled", hotplugging is > always forbidden. > * Test device is not hotplugged and get opregion in a single function. > * Update documentation along with code changes. > * Minor code style fixes. > Link: https://lore.kernel.org/qemu-devel/20250421163112.21316-1-tomitamoeko@gmail.coms > > Tomita Moeko (9): > 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: Check vendor and device ID on GVT-g mdev > vfio/igd: Check OpRegion support on GVT-g mdev > vfio/igd: Enable OpRegion by default > 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 > > docs/igd-assign.txt | 11 ++- > hw/vfio/igd.c | 218 ++++++++++++++++++++++++++------------------ > hw/vfio/pci.c | 2 +- > 3 files changed, 137 insertions(+), 94 deletions(-) > Looks ok to me, my Kaby Lake GVT-g and GVT-d configs still work. Reviewed-by: Alex Williamson <alex.williamson@redhat.com> Tested-by: Alex Williamson <alex.williamson@redhat.com>
I forgot adding v2 in subject, sorry for my mistake. Moeko On 4/29/25 00:09, Tomita Moeko wrote: > 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/20250325172239.27926-1-tomitamoeko@gmail.com > [2] https://edc.intel.com/content/www/us/en/design/publications/14th-generation-core-processors-cfg-and-mem-registers/d2-f0-processor-graphics-registers/ > > Changelog: > v2: > * Removed "Allow hotplugging with OpRegion enabled", hotplugging is > always forbidden. > * Test device is not hotplugged and get opregion in a single function. > * Update documentation along with code changes. > * Minor code style fixes. > Link: https://lore.kernel.org/qemu-devel/20250421163112.21316-1-tomitamoeko@gmail.coms > > Tomita Moeko (9): > 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: Check vendor and device ID on GVT-g mdev > vfio/igd: Check OpRegion support on GVT-g mdev > vfio/igd: Enable OpRegion by default > 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 > > docs/igd-assign.txt | 11 ++- > hw/vfio/igd.c | 218 ++++++++++++++++++++++++++------------------ > hw/vfio/pci.c | 2 +- > 3 files changed, 137 insertions(+), 94 deletions(-) >
On 5/5/25 09:33, Tomita Moeko wrote: > I forgot adding v2 in subject, sorry for my mistake. That's ok. Just use a v3 in the next spin, if needed. Only one patch, the last, is not reviewed yet. Will there be a v3 ? Thanks, C. > > Moeko > > On 4/29/25 00:09, Tomita Moeko wrote: >> 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/20250325172239.27926-1-tomitamoeko@gmail.com >> [2] https://edc.intel.com/content/www/us/en/design/publications/14th-generation-core-processors-cfg-and-mem-registers/d2-f0-processor-graphics-registers/ >> >> Changelog: >> v2: >> * Removed "Allow hotplugging with OpRegion enabled", hotplugging is >> always forbidden. >> * Test device is not hotplugged and get opregion in a single function. >> * Update documentation along with code changes. >> * Minor code style fixes. >> Link: https://lore.kernel.org/qemu-devel/20250421163112.21316-1-tomitamoeko@gmail.coms >> >> Tomita Moeko (9): >> 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: Check vendor and device ID on GVT-g mdev >> vfio/igd: Check OpRegion support on GVT-g mdev >> vfio/igd: Enable OpRegion by default >> 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 >> >> docs/igd-assign.txt | 11 ++- >> hw/vfio/igd.c | 218 ++++++++++++++++++++++++++------------------ >> hw/vfio/pci.c | 2 +- >> 3 files changed, 137 insertions(+), 94 deletions(-) >> >
On Mon, 2025-05-05 at 14:54 +0200, Cédric Le Goater wrote: > CAUTION: External Email!! > On 5/5/25 09:33, Tomita Moeko wrote: > > I forgot adding v2 in subject, sorry for my mistake. > > That's ok. Just use a v3 in the next spin, if needed. > > Only one patch, the last, is not reviewed yet. Will there be a v3 ? > > Thanks, > > C. > Sry, somehow missed the last patch. Have reviewed it now. -- Kind regards, Corvin
© 2016 - 2025 Red Hat, Inc.