Bug 1372901 - RFE: customize virtio display device model for aarch64 KVM guests
Summary: RFE: customize virtio display device model for aarch64 KVM guests
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Laszlo Ersek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-03 12:55 UTC by Laszlo Ersek
Modified: 2016-09-19 05:59 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-09-19 05:59:30 UTC
Embargoed:


Attachments (Terms of Use)

Description Laszlo Ersek 2016-09-03 12:55:54 UTC
Most of QEMU's PCI display devices:
- cirrus-vga ("cirrus" in libvirt lingo),
- VGA ("vga"),
- qxl-vga ("qxl"),
- virtio-vga ("virtio")
come with a linear framebuffer (sometimes called "VGA compatibility framebuffer"). This linear framebuffer lives in one of the PCI device's MMIO BARs, and allows guest code (primarily: firmware drivers, and non-accelerated OS drivers) to display graphics with direct memory access.

Due to architectural reasons, in AARCH64 KVM guests, this kind of framebuffer does not / cannot work. Cache coherency issues guarantee a corrupted / unusable display. The problem has been researched by several people, including kvm-arm maintainers, and it's been decided that the best way (practically the only way) to have boot time graphics console for AARCH64 KVM guests is to consolidate on QEMU's "virtio-gpu-pci" device. 

Accordingly, the qemu-system-aarch64 binary does not even include the "virtio-vga" device model -- it wouldn't work in KVM guests anyway. Whereas "virtio-gpu-pci" is a pure virtio device, without a linear framebuffer.

The ArmVirtQemu ("AAVMF") platform of edk2 (that is, the UEFI firmware for AARCH64 KVM guests) supports "virtio-gpu-pci", as of upstream commit 3ef3209d3028. (See <https://tianocore.acgmultimedia.com/show_bug.cgi?id=66>.)

From bug 1195176, libvirt supports

<devices>
  <video>
    <model type='virtio'/>
  </video>
</devices>

but as of current master (bae660869de0612bee2a740083fb494c27e3f80c), libvirt unconditionally maps type='virtio' to QEMU's "virtio-vga" device model. (See the qemuBuildDeviceVideoStr() function and the "qemuDeviceVideo" enum impl.)

This is not correct for AARCH64 guests, as the graphics drivers in edk2 are platform independent, and if there is a linear framebuffer, the drivers will prefer that. Generally speaking, this firmware default produces better guest OS compatibility (for example, it is required for x86_64 UEFI Windows guests), but specifically for AARCH64 KVM, due to the architectural issue mentioned above, libvirt should dictate a different policy. The means for this is to pass "-device virtio-gpu-pci" rather than "-device virtio-vga" -- in other words, explicitly disable the compatibility framebuffer.

Please customize libvirt so that <model type='virtio'/> generates "-device virtio-gpu-pci" for the AARCH64 target. Thank you.

Comment 3 Laszlo Ersek 2016-09-16 15:30:21 UTC
Upstream commit: 706b5b627719 ('qemu: map "virtio" video model to "virt" machtype correctly (arm/aarch64)')

Comment 4 Michal Privoznik 2016-09-19 05:59:30 UTC
Patch merged upstream. As this is an upstream bug, I'm closing it. Next release of libvirt will contain the fix.


Note You need to log in before you can comment on or make changes to this bug.