From nobody Mon Mar 30 03:25:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; envelope-from=libvir-list-bounces@redhat.com; helo=mx5-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) by mx.zohomail.com with SMTPS id 148898881324671.62586332116427; Wed, 8 Mar 2017 08:00:13 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28FudpF036105; Wed, 8 Mar 2017 10:56:40 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v28FucUw016508 for ; Wed, 8 Mar 2017 10:56:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 824EE2DB52; Wed, 8 Mar 2017 15:56:38 +0000 (UTC) Received: from inaba.usersys.redhat.com (unknown [10.34.129.229]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0767E2D654 for ; Wed, 8 Mar 2017 15:56:37 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 8 Mar 2017 16:56:30 +0100 Message-Id: <1488988591-9359-2-git-send-email-abologna@redhat.com> In-Reply-To: <1488988591-9359-1-git-send-email-abologna@redhat.com> References: <1488988591-9359-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-loop: libvir-list@redhat.com Subject: [libvirt] [RFC PATCH 1/2] qemu: Advertise ACPI support for aarch64 guests X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" So far, libvirt has assumed that only x86 supports ACPI, but that's inaccurate since aarch64 supports it too. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1429509 --- Advertising ACPI support in capabilities means that tools such as virt-manager will start automatically adding the element for new guests. However, existing guests are likely to lack that element and will suddenly lose ACPI capabilities: that could make them unbootable if the guest OS only supports booting via ACPI, which on the other hand is AFAIK not the case for current mainstream OSs. src/qemu/qemu_capabilities.c | 28 ++++++++++++++++--= ---- .../caps_2.6.0-gicv2.aarch64.xml | 1 + .../caps_2.6.0-gicv3.aarch64.xml | 1 + 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 5a3b4ac..4ec34f8 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1038,13 +1038,17 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, =20 machines =3D NULL; nmachines =3D 0; + } =20 + if ((ARCH_IS_X86(guestarch) || guestarch =3D=3D VIR_ARCH_AARCH64) && + virCapabilitiesAddGuestFeature(guest, "acpi", true, true) =3D=3D N= ULL) { + goto cleanup; } =20 if (ARCH_IS_X86(guestarch) && - (virCapabilitiesAddGuestFeature(guest, "acpi", true, true) =3D=3D = NULL || - virCapabilitiesAddGuestFeature(guest, "apic", true, false) =3D=3D= NULL)) + virCapabilitiesAddGuestFeature(guest, "apic", true, false) =3D=3D = NULL) { goto cleanup; + } =20 if ((guestarch =3D=3D VIR_ARCH_I686) && (virCapabilitiesAddGuestFeature(guest, "pae", true, false) =3D=3D = NULL || @@ -4122,10 +4126,15 @@ virQEMUCapsInitHelp(virQEMUCapsPtr qemuCaps, uid_t = runUid, gid_t runGid, const c qmperr) < 0) goto cleanup; =20 - /* -no-acpi is not supported on non-x86 - * even if qemu reports it in -help */ - if (!ARCH_IS_X86(qemuCaps->arch)) + /* Older QEMU versions reported -no-acpi in the output of -help even + * though it was not supported by the architecture. The issue has since + * been fixed, but to maintain compatibility with all release we still + * need to filter out the capability for architectures that we know + * don't support the feature, eg. anything but x86 and aarch64 */ + if (!ARCH_IS_X86(qemuCaps->arch) && + qemuCaps->arch !=3D VIR_ARCH_AARCH64) { virQEMUCapsClear(qemuCaps, QEMU_CAPS_NO_ACPI); + } =20 /* virQEMUCapsExtractDeviceStr will only set additional caps if qemu * understands the 0.13.0+ notion of "-device driver,". */ @@ -4222,9 +4231,14 @@ virQEMUCapsInitArchQMPBasic(virQEMUCapsPtr qemuCaps, goto cleanup; } =20 - /* ACPI/HPET/KVM PIT are x86 specific */ - if (ARCH_IS_X86(qemuCaps->arch)) { + /* ACPI only works on x86 and aarch64 */ + if (ARCH_IS_X86(qemuCaps->arch) || + qemuCaps->arch =3D=3D VIR_ARCH_AARCH64) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_ACPI); + } + + /* HPET and KVM PIT are x86 specific */ + if (ARCH_IS_X86(qemuCaps->arch)) { virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_HPET); virQEMUCapsSet(qemuCaps, QEMU_CAPS_NO_KVM_PIT); } diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml b/test= s/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml index 0aed651..b64a6f8 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv2.aarch64.xml @@ -40,6 +40,7 @@ + diff --git a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml b/test= s/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml index 1041a12..46e368f 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0-gicv3.aarch64.xml @@ -40,6 +40,7 @@ + --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list