This series enables "legacy mode" Intel graphics device assignment on SandyBridge and newer CPUs when coupled with a v4.6 Linux host kernel and updated SeaBIOS[1]. Legacy mode assignment in this context means that we modify the VM to supply the features required for IGD, such as an OpRegion, stolen memory, host bridge and ISA bridge, and VGA, as opposed to Intel's Universal Pass-Through (UPT) mode where IGD can be assigned as if it were a discrete PCI device, with no additional modifications of the VM. The benefit of legacy mode is that we can support older hardware, primary graphics mode in the VM, and physical display outputs. Additionally this series adds an new x-igd-opregion=on option which is intended to be coupled with UPT mode to enable physically connected displays. This has the same SeaBIOS requirement as legacy mode. What's new in v5? Support for generation 8 and newer IGD, such as Broadwell and Skylake. These GPUs support 64bit PTEs, changing the GTT sizing and layout. We also now invalidate the GTT which avoids the majority of DMAR faults when assigning these devices. OpRegion support is no longer automatic, except in legacy mode, since it can interfere with headless UPT setups. Legacy mode will only be enabled when IGD is configured at VM address 00:02.0, a ROM is present, VGA is available, and the host kernel supports vfio device specific regions providing the OpRegion, host config space, and ISA/LPC bridge config access. What's left to do? Obviously this is post-2.6 material, otherwise the remaining blocker is SeaBIOS support. SeaBIOS would prefer an interface that allows reserved memory regions to be assigned and populated generically and the base address returned to QEMU without SeaBIOS needing device specific code. What about OVMF/Q35? The VGA ROM is a critical component of IGD legacy mode, but IME the ROM is only a legacy ROM without UEFI support. Therefore I expect it would only be compatible with OVMF when run with a CSM, which is not our default. OpRegion support is certainly something we can investigate with OVMF for UPT+OpRegion mode on an OVMF VM. Q35 is unfortunately incompatible with legacy mode because in most configurations it already places an LPC/ISA bridge at address 00:1f.0 in the VM. We can't very well modify that PCI device to report itself as the host LPC bridge since the feature set of the Q35 bridge may be different. Again, UPT mode is the solution here. Legacy mode will not fail due to a Q35 machine type, but will fail if address 00:1f.0 is populated with anything other than a vfio-pci-igd-lpc-bridge device. Note to laptop users, I generally expect that screen dimming and lid switches are implemented in ACPI, outside of anything supported here. Laptop displays are also more fickle with generic drivers and may not work without native device drivers (ie. the windows basic driver may not drive the display during an install). Please test and review. Thanks, Alex [1] http://patchwork.ozlabs.org/patch/583731 --- Alex Williamson (7): vfio: Enable sparse mmap capability vfio: Create device specific region info helper vfio/pci: Fix return of vfio_populate_vga() vfio/pci: Consolidate VGA setup vfio/pci: Setup BAR quirks after capabilities probing vfio/pci: Intel graphics legacy mode assignment vfio/pci: Add a separate option for IGD OpRegion support hw/vfio/common.c | 103 +++++++ hw/vfio/pci-quirks.c | 617 +++++++++++++++++++++++++++++++++++++++++ hw/vfio/pci.c | 145 ++++++---- hw/vfio/pci.h | 8 + include/hw/vfio/vfio-common.h | 2 trace-events | 11 + 6 files changed, 824 insertions(+), 62 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html