Skip to content

RFC qemu vfo-pci: VGA support + initial round of device quirks

Alex Williamson kvm qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC 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+174 -00 replies
2/2qemu vfio-pci: Graphics device quirkshw/vfio_pci.c+479 -20 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/2] qemu vfo-pci: VGA support + initial round of device quirks

This series make use of the recently posted kernel-side vfio-pci support for accessing VGA ranges. This enables a handful of devices to be used as the primary (only) VM console. See patch 2 for a list of devices. These show seabios text mode output and work with standard VGA drivers. Accelerated drivers are not yet working. I'd appreciate feedback, including the overall design of incorporating VGA and legacy I/O regions into VFIO.

To reduce noise I'm not including the linux header update here, please see patch 3/3 of the kernel series for that. To test, grab the kernel patches and be sure to enable the new CONFIG_VFIO_PCI_VGA option. Then use the scripts/update-linux-headers.sh tool in the qemu tree passing it the location of the patched kernel tree. That should give you the headers necessary to build this.

As evidenced by patch 2 in this series, graphics cards don't particularly deal well with virtual device addresses. Every card I've encountered has some means of determining physical register addresses via backdoors. For instance the Radeon HD5450 reads the upper byte of the I/O port BAR address from VGA register 0x3c3, an unused VGA register. It then uses a data/window offset into the I/O port BAR to get the address of the MMIO BAR. I fear our quirks will grow without bounds unless we switch to allowing identity mapping of devices. Does anyone have any thoughts on how intrusive that would be? From my brief look, it appears it would cause chaos in seabios' PCI allocator. 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 |  655 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 653 insertions(+), 2 deletions(-)