From nobody Sat Feb 7 10:50:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1537457154442548.6863537930514; Thu, 20 Sep 2018 08:25:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 62F6631500B2; Thu, 20 Sep 2018 15:25:52 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 210EA84EE; Thu, 20 Sep 2018 15:25:52 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CAE70181A130; Thu, 20 Sep 2018 15:25:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8KFPaHk022175 for ; Thu, 20 Sep 2018 11:25:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id B54EE2010D04; Thu, 20 Sep 2018 15:25:36 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.74]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 393042010D02 for ; Thu, 20 Sep 2018 15:25:36 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Thu, 20 Sep 2018 17:25:21 +0200 Message-Id: <20180920152529.25973-4-abologna@redhat.com> In-Reply-To: <20180920152529.25973-1-abologna@redhat.com> References: <20180920152529.25973-1-abologna@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/11] qemu: Move armv7l-on-aarch64 special case 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 20 Sep 2018 15:25:53 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When running an armv7l guest on an aarch64 hosts, the qemu-system-aarch64 binary should be our first choice instead of qemu-system-arm since the former can take advantage of KVM acceleration. Move the special case to virQEMUCapsFindBinaryForArch() so that it's handled along with all other cases rather than on its own later on. Doing so will also make further refactoring easier. Signed-off-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 88f5b1f34e..09d4af70ec 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -708,6 +708,15 @@ virQEMUCapsFindBinaryForArch(virArch hostarch, const char *archstr; virArch target; =20 + /* armv7l guests can only take advantage of KVM on aarch64 hosts by + * using the qemu-system-aarch64 binary, so look for that one first + * to avoid using qemu-system-arm (and thus TCG) instead */ + if (hostarch =3D=3D VIR_ARCH_AARCH64 && guestarch =3D=3D VIR_ARCH_ARMV= 7L) { + archstr =3D virQEMUCapsArchToString(hostarch); + if ((ret =3D virQEMUCapsFindBinary("qemu-system-%s", archstr)) != =3D NULL) + goto out; + } + /* First attempt: try the guest architecture as it is */ archstr =3D virQEMUCapsArchToString(guestarch); if ((ret =3D virQEMUCapsFindBinary("qemu-system-%s", archstr)) !=3D NU= LL) @@ -762,24 +771,9 @@ virQEMUCapsInitGuest(virCapsPtr caps, "/usr/libexec/qemu-kvm", /* RHEL */ "qemu-kvm", /* Fedora */ "kvm", /* Debian/Ubuntu */ - NULL, }; =20 - /* x86 32-on-64 can be used with qemu-system-i386 and - * qemu-system-x86_64, so if we don't find a specific kvm binary, - * we can just fall back to the host arch native binary and - * everything works fine. - * - * arm is different in that 32-on-64 _only_ works with - * qemu-system-aarch64. So we have to add it to the kvmbins list - */ - if (hostarch =3D=3D VIR_ARCH_AARCH64 && guestarch =3D=3D VIR_ARCH_= ARMV7L) - kvmbins[3] =3D "qemu-system-aarch64"; - for (i =3D 0; i < ARRAY_CARDINALITY(kvmbins); ++i) { - if (!kvmbins[i]) - continue; - kvmbin =3D virFindFileInPath(kvmbins[i]); =20 if (!kvmbin) --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list