Skip to content
This repository was archived by the owner on Oct 27, 2025. It is now read-only.

Conversation

@rgrachek
Copy link

Summary

This set of patches enables GVT-d for Intel integrated GPUs in QEMU. This allows for passing an integrated GPU to a VM guest. It is intended for use with a Q35 machine type.

Dependencies

  • Patched host kernel (source)
  • OPROM (GOP can be dumped from host machine BIOS and converted to OPROM with EDK2 BaseTools)
  • IOMMU with passthrough enabled ( see command line below)
  • VFIO-PCI driver (see required driver blacklist below)
  • Disable framebuffer (see command line below)
  • PCH device ID patched in QEMU source for host platform (see Notes below)

Add the following to your kernel command line (replace xxxx with iGPU device ID):
intel_iommu=on iommu=pt video=efifb:off nofb vfio-pci.ids=8086:xxxx

Create /etc/modprobe.d/blacklist-i915.conf with the following contents:
blacklist snd_hda_intel
blacklist snd_hda_codec_hdmi
blacklist i915

Use the following QEMU arguments (GOP_GVTD.rom is our OPROM):
-display none -vga none -device vfio-pci,host=00:02.0,x-igd-gms=2,id=hostdev0,bus=pcie.0,addr=2,x-igd-opregion=on,romfile=GOP_GVTD.rom,driver=vfio-pci-nohotplug

Notes

You will need to change the PCH device ID to match the host platform in hw/isa/lpc_ich9.c.

An example for TGL:
k->device_id = PCI_DEVICE_ID_INTEL_ICH9_8;
to
k->device_id = 0xA080;

Wenzel and others added 5 commits January 12, 2023 13:03
build: add full_static option in compile_qemu_nyx.sh script
On Q35+ICH9, LPC sits at 0:1f.0. Force creating dummy LPC will override
ICH9 LPC on 0:1f.0. Thus breaking ICH9 functionality.
Some guest doesn't rely on PCH on 1f.0, thus it's still possible to
enable IGD legacy mode for Q35 without the dummp LPC as i440FX.

Signed-off-by: Colin Xu <colin.xu@intel.com>
Also pass the stolen info to fw_cfg so that OVMF can reserve according.

Signed-off-by: Hang Yuan <hang.yuan@intel.com>
Signed-off-by: Colin Xu <colin.xu@intel.com>
Kharos102 pushed a commit to Kharos102/kafl.qemu that referenced this pull request Jan 4, 2024
Reimplemented x86_64 page table walking code.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants