From nobody Mon Feb 9 11:33:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1499167167566346.08586154143734; Tue, 4 Jul 2017 04:19:27 -0700 (PDT) Received: from localhost ([::1]:40489 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLrX-0003jq-1H for importer@patchew.org; Tue, 04 Jul 2017 07:19:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dSLkp-0006Rc-D1 for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dSLkl-0001kw-TI for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:27 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:35903) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dSLkl-0001kb-Mu for qemu-devel@nongnu.org; Tue, 04 Jul 2017 07:12:23 -0400 Received: by mail-wr0-x241.google.com with SMTP id 77so46956705wrb.3 for ; Tue, 04 Jul 2017 04:12:23 -0700 (PDT) Received: from 640k.lan (94-39-191-51.adsl-ull.clienti.tiscali.it. [94.39.191.51]) by smtp.gmail.com with ESMTPSA id y5sm13613870wrd.52.2017.07.04.04.12.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:12:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=76B0DpQ/q8JSZrU3kdcKsWoCYGCqU9tI4ABz2uHqIIg=; b=cZzlol7bcSoZT7Mj1Ee8B2DaMYnSxCAFbSLaDmG8ldYJbnfScV5YVdtHChxMYT003c NovhZYy+S0AnFXCAYMXrC/ELlUUigIvGVPTkCZn25LUEhLpJ8zkLHUyrCijbMKdsngCl A73eHUD3NVaeObF6SGNBF4d6R9YWFOWUS8v/DRPES2Hj1S1G2Tq2oM8B4fHmUUrVRx3j 0Py32p5rQPDNF7sVZJAg4Z8lqBrfY7nLpty8qtuB1rxt+605hzZV/0zM1h63PdU8g4/F pnd9OiBF0DqLe80QE6s0qGXexFMobAcYCjMdW3MKCXKDnktltkMdB30Q1+uASbbE+nvr G3MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=76B0DpQ/q8JSZrU3kdcKsWoCYGCqU9tI4ABz2uHqIIg=; b=fTIjFSN1jPlBfRVMhQXu0KXJ4oeULVx9dsjwge9KToQoShIKbdyURS3adY4vNRU+2z DpYbUObnXI7vlAtfq/KGBZPHWTQMJZneuppzG/JDzZuRP+M+IbL15QEWWfbWXHR6Vu/7 /9BLRbktesCnFNKK/RlISqOuVVxiNJfv5Lhi5rXZBL+WiKlFBmjfazSHetjAzc8Cvg0S L9EBu2cuQNdRj6P7lGZeav9+s8PKl0Knj+d5AYbOcGGzkg/6rMh98MAtWWmBow/O+lKr UBWlxLGvZf6ye/6GNkvC1ZvXPDowN2Nda0miQ73vh1EC8AzRE9JwIxIkET5QtiyfOdWg piuQ== X-Gm-Message-State: AKS2vOwmSRzOnNg7QlHU1C58xT6z2+5eJHOkBCbFufWWw13sgBZ0u6XD N6OkitsN7O1T9tFmMIw= X-Received: by 10.223.155.150 with SMTP id d22mr33149054wrc.193.1499166742402; Tue, 04 Jul 2017 04:12:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 4 Jul 2017 13:11:54 +0200 Message-Id: <1499166735-39360-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> References: <1499166735-39360-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PATCH 01/22] configure: factor out list of supported Xen/KVM/HAX targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yang.zhong@intel.com, thuth@redhat.com, a.rigo@virtualopensystems.com, anthony.xu@intel.com, rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This will be useful when the functions are called, early in the configure process, to filter out targets that do not support hardware acceleration. Reviewed-by: Richard Henderson Reviewed-by: Daniel P. Berrange Signed-off-by: Paolo Bonzini --- configure | 90 ++++++++++++++++++++++++++++++++++++++---------------------= ---- 1 file changed, 55 insertions(+), 35 deletions(-) diff --git a/configure b/configure index c571ad1..0f14e79 100755 --- a/configure +++ b/configure @@ -163,6 +163,50 @@ have_backend () { echo "$trace_backends" | grep "$1" >/dev/null } =20 +glob() { + eval test -z '"${1#'"$2"'}"' +} + +supported_hax_target() { + test "$hax" =3D "yes" || return 1 + glob "$1" "*-softmmu" || return 1 + case "${1%-softmmu}" in + i386|x86_64) + return 0 + ;; + esac + return 1 +} + +supported_kvm_target() { + test "$kvm" =3D "yes" || return 1 + glob "$1" "*-softmmu" || return 1 + case "${1%-softmmu}:$cpu" in + arm:arm | aarch64:aarch64 | \ + i386:i386 | i386:x86_64 | i386:x32 | \ + x86_64:i386 | x86_64:x86_64 | x86_64:x32 | \ + mips:mips | mipsel:mips | \ + ppc:ppc | ppcemb:ppc | ppc64:ppc | \ + ppc:ppc64 | ppcemb:ppc64 | ppc64:ppc64 | \ + s390x:s390x) + return 0 + ;; + esac + return 1 +} + +supported_xen_target() { + test "$xen" =3D "yes" || return 1 + glob "$1" "*-softmmu" || return 1 + case "${1%-softmmu}:$cpu" in + arm:arm | aarch64:aarch64 | \ + i386:i386 | i386:x86_64 | x86_64:i386 | x86_64:x86_64) + return 0 + ;; + esac + return 1 +} + # default parameters source_path=3D$(dirname "$0") cpu=3D"" @@ -6178,46 +6222,22 @@ echo "TARGET_ABI_DIR=3D$TARGET_ABI_DIR" >> $config_= target_mak if [ "$HOST_VARIANT_DIR" !=3D "" ]; then echo "HOST_VARIANT_DIR=3D$HOST_VARIANT_DIR" >> $config_target_mak fi -case "$target_name" in - i386|x86_64) - if test "$xen" =3D "yes" -a "$target_softmmu" =3D "yes" ; then - echo "CONFIG_XEN=3Dy" >> $config_target_mak - if test "$xen_pci_passthrough" =3D yes; then + +if supported_xen_target $target; then + echo "CONFIG_XEN=3Dy" >> $config_target_mak + if test "$xen_pci_passthrough" =3D yes; then echo "CONFIG_XEN_PCI_PASSTHROUGH=3Dy" >> "$config_target_mak" - fi fi - ;; - *) -esac -case "$target_name" in - aarch64|arm|i386|x86_64|ppcemb|ppc|ppc64|s390x|mipsel|mips) - # Make sure the target and host cpus are compatible - if test "$kvm" =3D "yes" -a "$target_softmmu" =3D "yes" -a \ - \( "$target_name" =3D "$cpu" -o \ - \( "$target_name" =3D "ppcemb" -a "$cpu" =3D "ppc" \) -o \ - \( "$target_name" =3D "ppc64" -a "$cpu" =3D "ppc" \) -o \ - \( "$target_name" =3D "ppc" -a "$cpu" =3D "ppc64" \) -o \ - \( "$target_name" =3D "ppcemb" -a "$cpu" =3D "ppc64" \) -o \ - \( "$target_name" =3D "mipsel" -a "$cpu" =3D "mips" \) -o \ - \( "$target_name" =3D "x86_64" -a "$cpu" =3D "i386" \) -o \ - \( "$target_name" =3D "i386" -a "$cpu" =3D "x86_64" \) -o \ - \( "$target_name" =3D "x86_64" -a "$cpu" =3D "x32" \) -o \ - \( "$target_name" =3D "i386" -a "$cpu" =3D "x32" \) \) ; then - echo "CONFIG_KVM=3Dy" >> $config_target_mak - if test "$vhost_net" =3D "yes" ; then +fi +if supported_kvm_target $target; then + echo "CONFIG_KVM=3Dy" >> $config_target_mak + if test "$vhost_net" =3D "yes" ; then echo "CONFIG_VHOST_NET=3Dy" >> $config_target_mak echo "CONFIG_VHOST_NET_TEST_$target_name=3Dy" >> $config_host_mak - fi fi -esac -if test "$hax" =3D "yes" ; then - if test "$target_softmmu" =3D "yes" ; then - case "$target_name" in - i386|x86_64) - echo "CONFIG_HAX=3Dy" >> $config_target_mak - ;; - esac - fi +fi +if supported_hax_target $target; then + echo "CONFIG_HAX=3Dy" >> $config_target_mak fi if test "$target_bigendian" =3D "yes" ; then echo "TARGET_WORDS_BIGENDIAN=3Dy" >> $config_target_mak --=20 1.8.3.1