Skip to content

qemu vfio-pci: VGA passthrough support

Alex Williamson kvm 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2qemu vfio-pci: Add support for VGA MMIO and I/O port accesshw/vfio_pci.c+173 -00 replies
2/2qemu vfio-pci: Graphics device quirkshw/vfio_pci.c+476 -20 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/2] qemu vfio-pci: VGA passthrough support

I've pushed kernel side vfio vga support to my next branch and intend to try to get those in for kernel v3.9. Those changes can be found
here: git://github.com/awilliam/linux-vfio.git (next)

This is the matching QEMU updates. Patch 1/2 adds basic VGA range support. This can be used with the option "-vga none" to disable emulated VGA and also requires vfio-pci device option "x-vga=on". As noted by the x- prefix, this support is entirely experimental. Expectations should range anywhere from working perfectly to crashing the host.

Patch 2/2 contains numerous quirks for devices that I have onhand to test, but hopefully covers a faily broad spectrum (at least for ATI/AMD and Nvidia). These quirks trap various device specific addresses and insert device virtual addresses in place of device physical addresses. If we could identity map devices we could avoid these, but that also puts numerous constraints on our configuration.

The vfio kernel VGA support makes use of the VGA arbiter to switch between host VGA devices and I have been successful in running multiple devices simultaneously. At this point only secondary devices have been tested. The primary graphics likely needs extra work to completely turn off host kernel access. Intel integrated graphics have not been tested and are most certainly broken as they require access to devices other than the VGA device alone. Nvidia devices will work with nouveau in Linux guests, but do not work with Nvidia drivers in Windows (probably Linux too). I think we need to put these behind emulated PCIe root ports before they'll work, but Q35 doesn't work well enough for that yet. ATI/AMD cards seem to have the best hope of working with their Catalyst drivers.

For best results, use Q35, -vga none, x-vga=on, and x-bustype=2, for example:

-M q35 -vga none -device vfio-pci,host=x:xx.x,x-vga=on,x-bustype=2

All the qemu patches necessary for this can be found in this branch:

git://github.com/awilliam/qemu-vfio.git (vfio-vga-v3)

This series will depend on a kernel header update which I'll send patches for once the kernel patches are upstream. Thanks,

Alex

---

Alex Williamson (2):
qemu vfio-pci: Add support for VGA MMIO and I/O port access qemu vfio-pci: Graphics device quirks

 hw/vfio_pci.c |  651 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 649 insertions(+), 2 deletions(-)