From nobody Sat Feb 7 08:27:47 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.zohomail.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 1505293791968656.0209919922461; Wed, 13 Sep 2017 02:09:51 -0700 (PDT) Received: from localhost ([::1]:41068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ds3g7-00056Z-66 for importer@patchew.org; Wed, 13 Sep 2017 05:09:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ds3c5-0001Km-DP for qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:05:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ds3c2-0007FO-V3 for qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:05:41 -0400 Received: from mail-ua0-x242.google.com ([2607:f8b0:400c:c08::242]:36249) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ds3c2-0007Dt-NH for qemu-devel@nongnu.org; Wed, 13 Sep 2017 05:05:38 -0400 Received: by mail-ua0-x242.google.com with SMTP id k23so3890571uaf.3 for ; Wed, 13 Sep 2017 02:05:37 -0700 (PDT) Received: from localhost.localdomain ([190.66.154.128]) by smtp.gmail.com with ESMTPSA id r74sm2677601vkf.19.2017.09.13.02.05.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Sep 2017 02:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DtmkP1sElrkOXuzj2agLnJnLK86CstdrvAjOxmiM05w=; b=IYPHLmNh2UHUWwy2usXbZzcMMpVOqOgILfVIwnQoZjOAtNljpW6HCkOI+qswpNWk+R zNd6L61lW6TTOWS17LdjUNOTU4HUt8rQnrlHnslFGF5pUhqkpCay1PHzaoRmkOA2hJBU OuTYpS//Odl4344EW16agIlaoiGeJsAVQNMBYJ5h+LO8s76pE7df6yxpoTUlP3DVm8xu XxkoESF3mwhWNhVfozESCDzWRRpXJUNg8GkiwqWM9+ZavUMihW8kAZseK3xE5kU4Yz+F xR3l15Wb4yCqnSY8dvEgk7NlKAbq8D5jDsOoAmqHQz4VHg9v7jIzyNwE1H5uOkoq91So NylQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DtmkP1sElrkOXuzj2agLnJnLK86CstdrvAjOxmiM05w=; b=hw+7Y0TZzd9pfqebTfwrY4tL1maxrIWJ0HMdMGCC5a4W/PEh8VBmND24y5wpdFL3uj tUfZULBacdyMuaG+uFXHiPfIspVsAix7Ly7prpf1dAt3iVoS8Yotfk2fFQbyFyoWatak f9otEuu2theM+ch+atb0AuozBYVwYvHXmJkYfgrYbycg34rexf22BdNsnkBisA1DnIcs /fOyMhW2vuMobfKE3SWib9tiZqyklrohk5b7mbz6Pw1E3ilihO0zt0zDiEeINHYQ1ZsV X+HWIvK2MsKPh5ujWq7eaY6xuyV2HzYsYVl37ciZVC/ToAOvKBDTXZr0e0dTqtT39Hf+ x2Mw== X-Gm-Message-State: AHPjjUidiIwEHfm3dKL7CWUAZNcJXBqwKFtFBEx6vcNjWO4YAv1T73c4 jRrClI73JHdNt4Sz X-Google-Smtp-Source: AOwi7QALwvTvlfCQNJV4KjzSV42pY/lVLOV4d6yIxW1kfZPKnTc3mB5UEvLK0FZ/b3jwF62GlQpsQQ== X-Received: by 10.176.9.110 with SMTP id c46mr13902257uah.32.1505293536736; Wed, 13 Sep 2017 02:05:36 -0700 (PDT) From: Sergio Andres Gomez Del Real X-Google-Original-From: Sergio Andres Gomez Del Real To: qemu-devel@nongnu.org Date: Wed, 13 Sep 2017 04:05:09 -0500 Message-Id: <20170913090522.4022-2-Sergio.G.DelReal@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170913090522.4022-1-Sergio.G.DelReal@gmail.com> References: <20170913090522.4022-1-Sergio.G.DelReal@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::242 Subject: [Qemu-devel] [PATCH v4 01/14] hvf: add support for Hypervisor.framework in the configure script 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: Sergio Andres Gomez Del Real , pbonzini@redhat.com, stefanha@gmail.com 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 patch adds to the configure script the code to support the --enable-hvf argument. If the OS is Darwin, it checks for presence of HVF in the system. The patch also adds strings related to HVF in the file qemu-options.hx. QEMU will only support the modern syntax style '-M accel=3Dhvf' no enable hvf; the legacy '-enable-hvf' will not be supported. Signed-off-by: Sergio Andres Gomez Del Real --- configure | 38 ++++++++++++++++++++++++++++++++++++++ qemu-options.hx | 10 +++++----- 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/configure b/configure index dd73cce62f..5d9152b80a 100755 --- a/configure +++ b/configure @@ -211,6 +211,17 @@ supported_xen_target() { return 1 } =20 +supported_hvf_target() { + test "$hvf" =3D "yes" || return 1 + glob "$1" "*-softmmu" || return 1 + case "${1%-softmmu}" in + x86_64) + return 0 + ;; + esac + return 1 +} + supported_target() { case "$1" in *-softmmu) @@ -236,6 +247,7 @@ supported_target() { supported_kvm_target "$1" && return 0 supported_xen_target "$1" && return 0 supported_hax_target "$1" && return 0 + supported_hvf_target "$1" && return 0 print_error "TCG disabled, but hardware accelerator not available for = '$target'" return 1 } @@ -309,6 +321,7 @@ vhost_vsock=3D"no" vhost_user=3D"" kvm=3D"no" hax=3D"no" +hvf=3D"no" rdma=3D"" gprof=3D"no" debug_tcg=3D"no" @@ -727,6 +740,7 @@ Darwin) bsd=3D"yes" darwin=3D"yes" hax=3D"yes" + hvf=3D"yes" LDFLAGS_SHARED=3D"-bundle -undefined dynamic_lookup" if [ "$cpu" =3D "x86_64" ] ; then QEMU_CFLAGS=3D"-arch x86_64 $QEMU_CFLAGS" @@ -1027,6 +1041,10 @@ for opt do ;; --enable-hax) hax=3D"yes" ;; + --disable-hvf) hvf=3D"no" + ;; + --enable-hvf) hvf=3D"yes" + ;; --disable-tcg-interpreter) tcg_interpreter=3D"no" ;; --enable-tcg-interpreter) tcg_interpreter=3D"yes" @@ -1499,6 +1517,7 @@ disabled with --disable-FEATURE, default is enabled i= f available: bluez bluez stack connectivity kvm KVM acceleration support hax HAX acceleration support + hvf Hypervisor.framework acceleration support rdma RDMA-based migration support vde support for vde network netmap support for netmap network @@ -4900,6 +4919,21 @@ then fi =20 =20 +################################################# +# Check to see if we have the Hypervisor framework +if [ "$darwin" =3D=3D "yes" ] ; then + cat > $TMPC << EOF +#include +int main() { return 0;} +EOF + if ! compile_object ""; then + hvf=3D'no' + else + hvf=3D'yes' + LDFLAGS=3D"-framework Hypervisor $LDFLAGS" + fi +fi + ################################################# # Sparc implicitly links with --relax, which is # incompatible with -r, so --no-relax should be @@ -5356,6 +5390,7 @@ if test "$tcg" =3D "yes" ; then echo "TCG debug enabled $debug_tcg" echo "TCG interpreter $tcg_interpreter" fi +echo "HVF support $hvf" echo "RDMA support $rdma" echo "fdt support $fdt" echo "preadv support $preadv" @@ -6388,6 +6423,9 @@ fi if supported_hax_target $target; then echo "CONFIG_HAX=3Dy" >> $config_target_mak fi +if supported_hvf_target $target; then + echo "CONFIG_HVF=3Dy" >> $config_target_mak +fi if test "$target_bigendian" =3D "yes" ; then echo "TARGET_WORDS_BIGENDIAN=3Dy" >> $config_target_mak fi diff --git a/qemu-options.hx b/qemu-options.hx index 9f6e2adfff..bcb44420ee 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -31,7 +31,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ "-machine [type=3D]name[,prop[=3Dvalue][,...]]\n" " selects emulated machine ('-machine help' for list)\n" " property accel=3Daccel1[:accel2[:...]] selects accele= rator\n" - " supported accelerators are kvm, xen, hax or tcg (defa= ult: tcg)\n" + " supported accelerators are kvm, xen, hax, hvf or tcg = (default: tcg)\n" " kernel_irqchip=3Don|off|split controls accelerated ir= qchip support (default=3Doff)\n" " vmport=3Don|off|auto controls emulation of vmport (de= fault: auto)\n" " kvm_shadow_mem=3Dsize of KVM shadow MMU in bytes\n" @@ -66,7 +66,7 @@ Supported machine properties are: @table @option @item accel=3D@var{accels1}[:@var{accels2}[:...]] This is used to enable an accelerator. Depending on the target architectur= e, -kvm, xen, hax or tcg can be available. By default, tcg is used. If there is +kvm, xen, hax, hvf or tcg can be available. By default, tcg is used. If th= ere is more than one accelerator specified, the next one is used if the previous = one fails to initialize. @item kernel_irqchip=3Don|off @@ -120,13 +120,13 @@ ETEXI =20 DEF("accel", HAS_ARG, QEMU_OPTION_accel, "-accel [accel=3D]accelerator[,thread=3Dsingle|multi]\n" - " select accelerator (kvm, xen, hax or tcg; use 'help' = for a list)\n" - " thread=3Dsingle|multi (enable multi-threaded TCG)\n",= QEMU_ARCH_ALL) + " select accelerator (kvm, xen, hax, hvf or tcg; use 'h= elp' for a list)\n" + " thread=3Dsingle|multi (enable multi-threaded TCG)", Q= EMU_ARCH_ALL) STEXI @item -accel @var{name}[,prop=3D@var{value}[,...]] @findex -accel This is used to enable an accelerator. Depending on the target architectur= e, -kvm, xen, hax or tcg can be available. By default, tcg is used. If there is +kvm, xen, hax, hvf or tcg can be available. By default, tcg is used. If th= ere is more than one accelerator specified, the next one is used if the previous = one fails to initialize. @table @option --=20 2.14.1