From nobody Tue Feb 10 02:49:40 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 1499099817847547.7758911399845; Mon, 3 Jul 2017 09:36:57 -0700 (PDT) Received: from localhost ([::1]:36275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4LF-0001J6-JL for importer@patchew.org; Mon, 03 Jul 2017 12:36:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS4JU-0008OY-3b for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS4JQ-0007HR-UU for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:04 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS4JQ-0007HF-OJ for qemu-devel@nongnu.org; Mon, 03 Jul 2017 12:35:00 -0400 Received: by mail-wm0-x244.google.com with SMTP id j85so21509972wmj.0 for ; Mon, 03 Jul 2017 09:35:00 -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 r5sm4867459wmr.9.2017.07.03.09.34.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 09:34:58 -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=nDEfuZ3rCjn27T+9nOh6J4uoC74yL4LBCk4kYEp5BGs=; b=hmGXvhlf74se2OMNlQWcrKOxV4sawr1bAgtu8khmOLWpZKmaOMZOzfMKD3FcIoIxt1 fZxPzbCATUn2CEqhDb+wNePXjk0RH55xCDGKkMjsmw3yW12eRzqyAlZLMQXOplDhU5SL 8fTEB+V++BDX0eiuUrqLmpk25URgQKIuUHFWmMPX4uymnjtSkftZhscRJucJTMK5IBkj ksoWvFOSRtm+QbShvjtKMGxybXUUddYkRxOZxOqWEtNcBbmn1MA1HHnpOyvnTZZJtwdx 97peau8/jPIJweS/ymAH/bnG/dvaDwdGJfBkTWyWbFUnW5qBgtSt8ogZWOnRYi9F7uG6 H69Q== 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=nDEfuZ3rCjn27T+9nOh6J4uoC74yL4LBCk4kYEp5BGs=; b=OEFqbYMuIQpaw5pCKzkMLUwxaCAP3ZSIRFk9daKwX+AMFoWeKIy+am0RCYEY0NnarE FKWcoL9BukUU59t2X/7clIEq4JyDYusB0Hne2vEQy098We7QkDSPXNE8VWk4UcqSl/kk WYPcgpQ0emxdFz4/DQrGD48P8+Od2bASb563hYX8KblwFL8XG50PEC38JDbSBXdUW0/s Q+6WhsbYl/M2RxE/iS9gGYC++W/3PdXNsSEIHfv6rVqW+yOfAqbjFTpDRXIo5yPWyWTO 1Wqms0cxEnRS4ejNH0N8A885O48DJrSw75CaOD/Y26UEFyBP/TE3xV8u8f7fCJKIVAm4 bMXg== X-Gm-Message-State: AIVw110NnOuhOLm6xvFNeWI+TclVCBQsOwNq7fJrp/sZNQwvdg41Hpj1 hA5VyVtoLODWB96sC24= X-Received: by 10.28.131.130 with SMTP id f124mr5624757wmd.25.1499099699373; Mon, 03 Jul 2017 09:34:59 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 3 Jul 2017 18:34:32 +0200 Message-Id: <1499099693-22903-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1499099693-22903-1-git-send-email-pbonzini@redhat.com> References: <1499099693-22903-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:c09::244 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. Signed-off-by: Paolo Bonzini Reviewed-by: Daniel P. Berrange Reviewed-by: Richard Henderson --- 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