Graphics Card Support For QEMU/KVM Comes Closer
One of the major limitations of QEMU/KVM when it comes to Linux desktop virtualization is that it hasn't provided any form of support for graphics acceleration -- either by passing OpenGL calls onto the host for execution by the host's driver and graphics hardware or allowing guest VMs to tap directly the graphics card. Support for the latter feature continues to be developed and is close to becoming a working reality.
Allowing QEMU virtual machines to directly interact with PCI devices has become a reality with the merging of the VFIO driver last August. VFIO for the Linux kernel provides a secure interface for device access using IOMMU so that, among other purposes, a physical PCI device could be assigned to a QEMU guest. Up to this point in the KVM world there were basically some x86 hacks to allow similar support.
QEMU 1.3 picked up VFIO support (among other interesting and fun features), but VFIO hasn't supported graphics cards but only more simple PCI-based devices. As I wrote about at the beginning of the month, QEMU is getting close to allow passing GPUs to guests.
Published today on the Linux kernel mailing list was a new patch for VFIO-PCI to add support for VGA region access. The to-be-added VFIO_PCI_VGA kernel option allows for a VGA extension to the VFIO PCI driver that exposes an additional region on VGA devices for accessing legacy VGA addresses used by BIOS and generic video graphics drivers.
While there's that kernel patch, published since the other Phoronix article earlier this month were QEMU patches. The QEMU patches rely upon the VFIO kernel support for accessing VGA ranges. Accelerated hardware graphics drivers don't work with these initial QEMU patches, but it's working so far for graphics adapters using the SeaBIOS text mode output with standard VGA drivers.
The QEMU patches explain:
Most VGA cards need some kind of quirk to fully operate since they hide backdoors to get to other registers outside of PCI config space within the registers, but this provides the base infrastructure. If we could identity map PCI resources for assigned devices we would need a lot fewer quirks.Additionally:
Apparently graphics vendors need to come up with new ways to retrieve PCI BAR addresses on every revision of their chip. These are the ones that I've found on the following assortment of cards:At least they're slowly moving in the right direction...
Latest Articles & Reviews
Latest Linux News
Most Viewed News This Week