Bug 1435770 - Error when starting mach-virt guests with TCG
Summary: Error when starting mach-virt guests with TCG
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Andrea Bolognani
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-24 17:36 UTC by Andrea Bolognani
Modified: 2017-06-12 09:45 UTC (History)
2 users (show)

Fixed In Version: libvirt-3.4.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-12 09:45:35 UTC
Embargoed:


Attachments (Terms of Use)

Description Andrea Bolognani 2017-03-24 17:36:49 UTC
TCG aarch64/virt and armv7l/virt guests currently fail to
start when using libvirt 3.0.0 or newer:

  error: internal error: qemu unexpectedly closed the monitor:
    2017-03-24T16:59:31.896680Z qemu-kvm: -device ioh3420,[...]:
      MSI is not supported by interrupt controller
    2017-03-24T16:59:31.897783Z qemu-kvm: -device ioh3420,[...]:
      Device initialization failed

Now that libvirt has switched to using virtio-pci by default
for mach-virt guests, MSI support has become a requirement.

QEMU (correctly) advertises both emulated GICv2 and emulated
GICv3 as available to TCG guests, but only the former supports
MSI at the moment; not being aware of this, the very simple
GIC version choosing logic in libvirt ("newer is better") will
result in GICv3 being picked.

The solution is ultimately to have GICv3 support MSI; in the
meantime, libvirt should ensure aarch64/virt and armv7l/virt
guests work out of the box by either using GICv2 instead
(preferred) or switching back to virtio-mmio.

Comment 1 Andrea Bolognani 2017-03-24 17:44:38 UTC
Workarounds for the time being: replace

  <features>
    <gic version='3'/>
  </features>

with

  <features>
    <gic version='2'/>
  </features>

(preferred) or replace all

  <address type='pci' [...]/>

with

  <address type='virtio-mmio'/>

You can control these settings at install time, when
using virt-install, with

  $ virt-install \
    --feature gic_version=2 \
    [...]

and

  $ virt-install \
    --disk [...],address.type=virtio-mmio \
    --network [...],address.type=virtio-mmio \
    [...]

respectively.

Comment 2 Andrea Bolognani 2017-06-12 09:45:35 UTC
The fix has been merged upstream and is part of the 3.4.0
release.

commit bc07101a7c2cd2ce07ad1ca28c47e0a7cde5625d
Author: Andrea Bolognani <abologna>
Date:   Fri May 12 13:29:57 2017 +0200

    qemu: Use GICv2 for aarch64/virt TCG guests

    There are currently some limitations in the emulated GICv3
    that make it unsuitable as a default. Use GICv2 instead.

    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1450433

    Signed-off-by: Andrea Bolognani <abologna>


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