From nobody Mon Feb 9 10:47:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1489081272044124.49417408552301; Thu, 9 Mar 2017 09:41:12 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v29HbhDp007013; Thu, 9 Mar 2017 12:37:43 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v29HbhZ7011988 for ; Thu, 9 Mar 2017 12:37:43 -0500 Received: from inaba.usersys.redhat.com (ovpn-204-47.brq.redhat.com [10.40.204.47]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v29HbeOl032467 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 9 Mar 2017 12:37:42 -0500 From: Andrea Bolognani To: libvir-list@redhat.com Date: Thu, 9 Mar 2017 18:37:34 +0100 Message-Id: <1489081057-12677-2-git-send-email-abologna@redhat.com> In-Reply-To: <1489081057-12677-1-git-send-email-abologna@redhat.com> References: <1489081057-12677-1-git-send-email-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/4] 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 --- 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