Skip to content

xen: add Intel IGD passthrough support

Tiejun Chen dri-devel intel-gfx qemu-devel xen-devel 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest5 patches 163 repliesIn review
  2. v45 patches 24 repliesSuperseded
  3. v3 posting 2/25 patches 21 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v3 posting 1/20 of 8 patches1 replySuperseded
v28 patches66 repliesSuperseded

Changes in v5 from the cover letter

* Don't set that ISA class property, instead, just fake this ISA bridge with 00:1f.0.
* Don't pass vendor/device ids in igd_pci_read().
* Add to support offset 0x44/0x48.
* Just rebase.

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5xen, gfx passthrough: basic graphics passthrough supporthw/xen/Makefile.objs hw/xen/xen-host-pci-device.c hw/xen/xen-host-pci-device.h +5 more+272 -15 replies
2/5xen, gfx passthrough: create pseudo intel isa bridgehw/xen/xen_pt_graphics.c+61 -021 replies
3/5xen, gfx passthrough: support Intel IGD passthrough with VT-Dhw/xen/xen_pt.h hw/xen/xen_pt_graphics.c+160 -08 replies
4/5xen, gfx passthrough: create host bridge to passthroughhw/pci-host/piix.c+54 -211 replies
5/5xen, gfx passthrough: add opregion mappinghw/xen/xen_pt.h hw/xen/xen_pt_config_init.c hw/xen/xen_pt_graphics.c+116 -24 replies

Reviews trailers per patch

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

Read the v5 thread

Cover letter [Qemu-devel] [v5][PATCH 0/5] xen: add Intel IGD passthrough support

V5 is generated just based on Paolo's some comments.

v5:

* Don't set that ISA class property, instead, just fake this ISA bridge with 00:1f.0.
* Don't pass vendor/device ids in igd_pci_read().
* Add to support offset 0x44/0x48.
* Just rebase.

v4:

* Fix some typos in the patch head description.
* Improve some comments.
* Given that xen_pt_register_vga_regions()/xen_pt_unregister_vga_regions() are called unconditionally, so we just return 0 there.
* Remove one spurious change.
* Remove some unnecessary "return" in void foo().
* Given that pci_create_pch() is called unconditionally, so we just return 0 even if its failed to check xen_has_gfx_passthru.
* Use (xen_enabled() && xen_has_gfx_passthru) to make sure we only work in this scenario.

v3:

* In this case, as we discussed we will give priority to devices to reserve a specific devfn by passing "device_model_args_hvm = ['-device', 'xen-platform,addr=0x3']" and "vga=none", so withdraw patch #1, #2 and #4.
* Fix some typos.
* Add more comments to make that readable.
* To unmap igd_opregion when call xen_pt_unregister_vga_regions().
* Improve some return paths.
* Force to convert igd_guest/host_opoegion as an unsigned long type while calling xc_domain_memory_mapping().
* We need to map 3 pages for opregion as hvmloader set.

v2:

* rebase on current qemu tree.
* retrieve VGA bios from sysfs properly.
* redefine some function name.
* introduce bitmap to manage registe/runregister pci dev, and provide a common way to reserve some specific devfn.
* introduce is_igd_passthrough() to make sure we touch physical host bridge only in IGD case.
* We should return zero as an invalid address value while calling igd_read_opregion().

Additionally, now its also not necessary to recompile seabios with some extra steps like v1.

The following patches are ported partially from Xen Qemu-traditional branch which are adding Intel IGD passthrough supporting to Qemu upstream.

To pass through IGD to guest, user need to add following lines in Xen config file:
gfx_passthru=1
pci=['00:02.0@2']

Now successfully boot Ubuntu 14.04/Windows 7 guests with IGD assigned in Haswell desktop with Latest Xen + Qemu upstream.

----------------------------------------------------------------
Tiejun Chen (5):
xen, gfx passthrough: basic graphics passthrough support xen, gfx passthrough: create pseudo intel isa bridge xen, gfx passthrough: support Intel IGD passthrough with VT-D xen, gfx passthrough: create host bridge to passthrough xen, gfx passthrough: add opregion mapping

 hw/pci-host/piix.c           |  56 +++++++++++++++-
 hw/xen/Makefile.objs         |   2 +-
 hw/xen/xen-host-pci-device.c |   5 ++
 hw/xen/xen-host-pci-device.h |   1 +
 hw/xen/xen_pt.c              |  10 +++
 hw/xen/xen_pt.h              |  12 +++-
 hw/xen/xen_pt_config_init.c  |  50 +++++++++++++-
 hw/xen/xen_pt_graphics.c     | 513 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 qemu-options.hx              |   9 +++
 vl.c                         |  10 +++
 10 files changed, 663 insertions(+), 5 deletion

Thanks
Tiejun