From: Sergio Andres Gomez Del Real <sergio.g.delreal@gmail.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, stefanha@gmail.com,
Sergio Andres Gomez Del Real <Sergio.G.DelReal@gmail.com>
Subject: [Qemu-devel] [PATCH v3 01/14] hvf: add support for Hypervisor.framework in the configure script
Date: Mon, 4 Sep 2017 22:54:44 -0500 [thread overview]
Message-ID: <20170905035457.3753-2-Sergio.G.DelReal@gmail.com> (raw)
In-Reply-To: <20170905035457.3753-1-Sergio.G.DelReal@gmail.com>
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 <Sergio.G.DelReal@gmail.com>
---
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 <Hypervisor/hv.h>
+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
--
2.14.1
next prev parent reply other threads:[~2017-09-05 3:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-05 3:54 [Qemu-devel] [PATCH v3 00/14] add support for Hypervisor.framework in QEMU Sergio Andres Gomez Del Real
2017-09-05 3:54 ` Sergio Andres Gomez Del Real [this message]
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 02/14] hvf: add code base from Google's QEMU repository Sergio Andres Gomez Del Real
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 03/14] hvf: fix licensing issues; isolate task handling code (GPL v2-only) Sergio Andres Gomez Del Real
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 04/14] hvf: run hvf code through checkpatch.pl and fix style issues Sergio Andres Gomez Del Real
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 05/14] hvf: add code to cpus.c and do refactoring in preparation for compiling Sergio Andres Gomez Del Real
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 06/14] hvf: handle fields from CPUState and CPUX86State Sergio Andres Gomez Del Real
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 07/14] apic: add function to apic that will be used by hvf Sergio Andres Gomez Del Real
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 08/14] hvf: add compilation rules to Makefile.objs Sergio Andres Gomez Del Real
2017-09-05 4:03 ` Sergio Andrés Gómez del Real
2017-09-06 1:12 ` Sergio Andrés Gómez del Real
2017-09-06 13:57 ` Stefan Hajnoczi
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 09/14] hvf: use new helper functions for put/get xsave Sergio Andres Gomez Del Real
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 10/14] hvf: implement hvf_get_supported_cpuid Sergio Andres Gomez Del Real
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 11/14] hvf: refactor cpuid code Sergio Andres Gomez Del Real
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 12/14] hvf: implement vga dirty page tracking Sergio Andres Gomez Del Real
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 13/14] hvf: refactor event injection code for hvf Sergio Andres Gomez Del Real
2017-09-05 3:54 ` [Qemu-devel] [PATCH v3 14/14] hvf: inject General Protection Fault when vmexit through vmcall Sergio Andres Gomez Del Real
2017-09-05 3:59 ` [Qemu-devel] [PATCH v3 00/14] add support for Hypervisor.framework in QEMU Sergio Andrés Gómez del Real
2017-09-05 9:24 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170905035457.3753-2-Sergio.G.DelReal@gmail.com \
--to=sergio.g.delreal@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).