From patchwork Tue Sep 5 03:54:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?UTF-8?q?Sergio=20Andr=C3=A9s=20G=C3=B3mez=20Del=20Real?= X-Patchwork-Id: 9937741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 61693601EB for ; Tue, 5 Sep 2017 03:56:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 544972886F for ; Tue, 5 Sep 2017 03:56:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48FE328871; Tue, 5 Sep 2017 03:56:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B0C8A2886F for ; Tue, 5 Sep 2017 03:56:48 +0000 (UTC) Received: from localhost ([::1]:56707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp4yl-0001Z9-Uz for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 Sep 2017 23:56:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp4xS-0001YJ-4N for qemu-devel@nongnu.org; Mon, 04 Sep 2017 23:55:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dp4xN-0007dd-21 for qemu-devel@nongnu.org; Mon, 04 Sep 2017 23:55:26 -0400 Received: from mail-ua0-x243.google.com ([2607:f8b0:400c:c08::243]:35027) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dp4xM-0007dF-SA for qemu-devel@nongnu.org; Mon, 04 Sep 2017 23:55:20 -0400 Received: by mail-ua0-x243.google.com with SMTP id g47so847543uad.2 for ; Mon, 04 Sep 2017 20:55:20 -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=nEKu+JpUcnQmKUY4j5+eNoJLm4d2Ua78GEpkNqUfLbG9R3DxnRdW8MGMZadiCMz8LB a0JFuN5gsJktmPgsaC9QGpkkFv3Qwa3jDR9J8YWH+yPzGC/JI8SiW/EdKQk+wIT1ooqJ kO/eiM1yfeHjAQ8gMOsXjTgMI8ZlkZzXFN56wddk/SWbI3VNvcr+gQqjDnHqWvSuDoQV fvg592yICMXOo5AtvbtE0UT7zJyFk3BxG1sbknPk9fPxSP+nlxFH8HBBS1SHhqhamNPq VJZKLT5BwBxlqTwNlxIf0tJESmX7kqV43dI5VsXTloh80GrD+QHVTJMc8NmlS8B4cBpz KJWA== 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=Ca460z44YhJiVab4YUrCCyRthcGOjUM+6pn12DVoPoFDFNyvkyXa9BHzUwpinjKbO2 yDHBE2zkaDm1Nv+rP4e/kTr78c0QKnqAcuZA0rZ8A90AWMi/ldC8bM0hBXXb4oBaICbV ksRBA0xL22PCjYEGMtnmZfT14z/HRY/iNMFT8xu1AbRytEz6CaGpFEnIf7y3hkaVTusK 2Rw0CLYgjgHj/ja4x2j8q/57HzJl8LqRh8j8jsXw2jnY1k0rN7nlRmll7VvCEehRyBj8 5aH//PpP3REg0dV7+i6g5Gsn4ICHWSZnhXYxnDaPNnpWGjvVeiZ562YGbqCdRnzqMlKN osjQ== X-Gm-Message-State: AHPjjUiXMhaSdZkO7tyVitr3T1n2FQ8NaKl7O3EYYmcPQ08EMj0GjhzF npUhTzDxOxcJpicg X-Google-Smtp-Source: ADKCNb4i1ZKn3xUKAl5/h2TyJcNpdeR7XlEVq323kyPJgWdtgKfSr/88IRKKkP6aOnLY7h31pyb7kg== X-Received: by 10.159.59.164 with SMTP id r36mr1707948uah.169.1504583719993; Mon, 04 Sep 2017 20:55:19 -0700 (PDT) Received: from localhost.localdomain ([161.10.80.59]) by smtp.gmail.com with ESMTPSA id d206sm1877252vka.29.2017.09.04.20.55.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Sep 2017 20:55:19 -0700 (PDT) From: Sergio Andres Gomez Del Real X-Google-Original-From: Sergio Andres Gomez Del Real To: qemu-devel@nongnu.org Date: Mon, 4 Sep 2017 22:54:44 -0500 Message-Id: <20170905035457.3753-2-Sergio.G.DelReal@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170905035457.3753-1-Sergio.G.DelReal@gmail.com> References: <20170905035457.3753-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::243 Subject: [Qemu-devel] [PATCH v3 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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=hvf' 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 } +supported_hvf_target() { + test "$hvf" = "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="no" vhost_user="" kvm="no" hax="no" +hvf="no" rdma="" gprof="no" debug_tcg="no" @@ -727,6 +740,7 @@ Darwin) bsd="yes" darwin="yes" hax="yes" + hvf="yes" LDFLAGS_SHARED="-bundle -undefined dynamic_lookup" if [ "$cpu" = "x86_64" ] ; then QEMU_CFLAGS="-arch x86_64 $QEMU_CFLAGS" @@ -1027,6 +1041,10 @@ for opt do ;; --enable-hax) hax="yes" ;; + --disable-hvf) hvf="no" + ;; + --enable-hvf) hvf="yes" + ;; --disable-tcg-interpreter) tcg_interpreter="no" ;; --enable-tcg-interpreter) tcg_interpreter="yes" @@ -1499,6 +1517,7 @@ disabled with --disable-FEATURE, default is enabled if 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 +################################################# +# Check to see if we have the Hypervisor framework +if [ "$darwin" == "yes" ] ; then + cat > $TMPC << EOF +#include +int main() { return 0;} +EOF + if ! compile_object ""; then + hvf='no' + else + hvf='yes' + LDFLAGS="-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" = "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=y" >> $config_target_mak fi +if supported_hvf_target $target; then + echo "CONFIG_HVF=y" >> $config_target_mak +fi if test "$target_bigendian" = "yes" ; then echo "TARGET_WORDS_BIGENDIAN=y" >> $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=]name[,prop[=value][,...]]\n" " selects emulated machine ('-machine help' for list)\n" " property accel=accel1[:accel2[:...]] selects accelerator\n" - " supported accelerators are kvm, xen, hax or tcg (default: tcg)\n" + " supported accelerators are kvm, xen, hax, hvf or tcg (default: tcg)\n" " kernel_irqchip=on|off|split controls accelerated irqchip support (default=off)\n" " vmport=on|off|auto controls emulation of vmport (default: auto)\n" " kvm_shadow_mem=size of KVM shadow MMU in bytes\n" @@ -66,7 +66,7 @@ Supported machine properties are: @table @option @item accel=@var{accels1}[:@var{accels2}[:...]] This is used to enable an accelerator. Depending on the target architecture, -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 there is more than one accelerator specified, the next one is used if the previous one fails to initialize. @item kernel_irqchip=on|off @@ -120,13 +120,13 @@ ETEXI DEF("accel", HAS_ARG, QEMU_OPTION_accel, "-accel [accel=]accelerator[,thread=single|multi]\n" - " select accelerator (kvm, xen, hax or tcg; use 'help' for a list)\n" - " thread=single|multi (enable multi-threaded TCG)\n", QEMU_ARCH_ALL) + " select accelerator (kvm, xen, hax, hvf or tcg; use 'help' for a list)\n" + " thread=single|multi (enable multi-threaded TCG)", QEMU_ARCH_ALL) STEXI @item -accel @var{name}[,prop=@var{value}[,...]] @findex -accel This is used to enable an accelerator. Depending on the target architecture, -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 there is more than one accelerator specified, the next one is used if the previous one fails to initialize. @table @option