From patchwork Tue Jan 28 10:51:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamil Rytarowski X-Patchwork-Id: 1230294 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=N/mO5DYL; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 486NlS1xKLz9sNx for ; Tue, 28 Jan 2020 21:53:56 +1100 (AEDT) Received: from localhost ([::1]:56914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwOVG-0000cY-39 for incoming@patchwork.ozlabs.org; Tue, 28 Jan 2020 05:53:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52389) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwOTp-0000cP-AV for qemu-devel@nongnu.org; Tue, 28 Jan 2020 05:52:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwOTn-0004is-Ua for qemu-devel@nongnu.org; Tue, 28 Jan 2020 05:52:25 -0500 Received: from mout.gmx.net ([212.227.15.18]:51839) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iwOTn-0004i9-Hr for qemu-devel@nongnu.org; Tue, 28 Jan 2020 05:52:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1580208735; bh=WsY8swjSmAssMYRjClxdfY23Vl55y4mQ4Au8Z2MDGSk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=N/mO5DYLCX3JMF+Y86xwtHJgZpugWtzAejOJfioU+CI06v8d0GwNxvhrlDQZuXM83 jw1mLMUKNKqiLGYwwfq2EDZMX/337198P/OGc2UocSetWw5q+Fn88kgYnvqVKShoPK pJBxY/jM6rG6Dg7t0fx5+aYnBLi7WbT2+VNf63rU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([89.71.135.231]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MUosN-1j5ZXj3rVZ-00Qkb3; Tue, 28 Jan 2020 11:52:15 +0100 From: Kamil Rytarowski To: slp@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, max@m00nbsd.net Subject: [PATCH v2 2/4] Add the NetBSD Virtual Machine Monitor accelerator. Date: Tue, 28 Jan 2020 11:51:33 +0100 Message-Id: <20200128105133.2245-1-n54@gmx.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200128085438.hhz3f55bow75zl35@dritchie> References: <20200128085438.hhz3f55bow75zl35@dritchie> MIME-Version: 1.0 X-Provags-ID: V03:K1:Pw18AC6T4KJLsRdTk22pD7W9h16uzXrbVMEBqbGsvQb44zrTidt IWj3YuxzJ2skm96+LB9zOVCnw7lhpo7u/iRLBYP3XwVqgjr7aJnooY1k7HID71rpnhmjKGo EWBAuT+q2ZpXtweLMdSbj2LIAS9cmtLpkTFnDQk9XPvjvvm51X4bhCXS8i/Roirk7ZSVbyD Ab8Yh1N75C5/flsmKIRRw== X-UI-Out-Filterresults: notjunk:1; V03:K0:NW42WudnbNc=:UmV/dD1X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vbI2EySIIEaE5EhVstUtoiMLHRQpvyuUd+l5J245gW3etNWOehJHGYG 7Ooe76ROXM0RecUO3j1TbTuYjBDNGhx3d5ap67wa1if1O9/Xui10hmytFaQcT5Oo1awNXu/6G LDUGWhtZ6RiJlvpVHLPFESTjZc+v9k6WfEbPfTfSGto5E+6DDkxy6bORSYyw+2Pyq2EFA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.18 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kamil Rytarowski , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Maxime Villard Introduces the configure support for the new NetBSD Virtual Machine Monitor that allows for hypervisor acceleration from usermode components on the NetBSD platform. Signed-off-by: Maxime Villard Signed-off-by: Kamil Rytarowski Reviewed-by: Sergio Lopez --- configure | 36 ++++++++++++++++++++++++++++++++++++ qemu-options.hx | 16 ++++++++-------- 2 files changed, 44 insertions(+), 8 deletions(-) -- 2.24.1 diff --git a/configure b/configure index 0ce2c0354a..eb456a271e 100755 --- a/configure +++ b/configure @@ -241,6 +241,17 @@ supported_whpx_target() { return 1 } +supported_nvmm_target() { + test "$nvmm" = "yes" || return 1 + glob "$1" "*-softmmu" || return 1 + case "${1%-softmmu}" in + i386|x86_64) + return 0 + ;; + esac + return 1 +} + supported_target() { case "$1" in *-softmmu) @@ -268,6 +279,7 @@ supported_target() { supported_hax_target "$1" && return 0 supported_hvf_target "$1" && return 0 supported_whpx_target "$1" && return 0 + supported_nvmm_target "$1" && return 0 print_error "TCG disabled, but hardware accelerator not available for '$target'" return 1 } @@ -387,6 +399,7 @@ kvm="no" hax="no" hvf="no" whpx="no" +nvmm="no" rdma="" pvrdma="" gprof="no" @@ -1168,6 +1181,10 @@ for opt do ;; --enable-whpx) whpx="yes" ;; + --disable-nvmm) nvmm="no" + ;; + --enable-nvmm) nvmm="yes" + ;; --disable-tcg-interpreter) tcg_interpreter="no" ;; --enable-tcg-interpreter) tcg_interpreter="yes" @@ -1768,6 +1785,7 @@ disabled with --disable-FEATURE, default is enabled if available: hax HAX acceleration support hvf Hypervisor.framework acceleration support whpx Windows Hypervisor Platform acceleration support + nvmm NetBSD Virtual Machine Monitor acceleration support rdma Enable RDMA-based migration pvrdma Enable PVRDMA support vde support for vde network @@ -2757,6 +2775,20 @@ if test "$whpx" != "no" ; then fi fi +########################################## +# NetBSD Virtual Machine Monitor (NVMM) accelerator check +if test "$nvmm" != "no" ; then + if check_include "nvmm.h" ; then + nvmm="yes" + LIBS="-lnvmm $LIBS" + else + if test "$nvmm" = "yes"; then + feature_not_found "NVMM" "NVMM is not available" + fi + nvmm="no" + fi +fi + ########################################## # Sparse probe if test "$sparse" != "no" ; then @@ -6495,6 +6527,7 @@ echo "KVM support $kvm" echo "HAX support $hax" echo "HVF support $hvf" echo "WHPX support $whpx" +echo "NVMM support $nvmm" echo "TCG support $tcg" if test "$tcg" = "yes" ; then echo "TCG debug enabled $debug_tcg" @@ -7771,6 +7804,9 @@ fi if test "$target_aligned_only" = "yes" ; then echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak fi +if supported_nvmm_target $target; then + echo "CONFIG_NVMM=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 e9d6231438..4ddf7c91a0 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, hvf, whpx or tcg (default: tcg)\n" + " supported accelerators are kvm, xen, hax, hvf, nvmm, whpx or tcg (default: tcg)\n" " vmport=on|off|auto controls emulation of vmport (default: auto)\n" " dump-guest-core=on|off include guest memory in a core dump (default=on)\n" " mem-merge=on|off controls memory merge support (default: on)\n" @@ -63,9 +63,9 @@ 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, hvf, whpx 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. +kvm, xen, hax, hvf, nvmm, whpx 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 vmport=on|off|auto Enables emulation of VMWare IO port, for vmmouse etc. auto says to select the value based on accel. For accel=xen the default is off otherwise the default @@ -110,7 +110,7 @@ ETEXI DEF("accel", HAS_ARG, QEMU_OPTION_accel, "-accel [accel=]accelerator[,prop[=value][,...]]\n" - " select accelerator (kvm, xen, hax, hvf, whpx or tcg; use 'help' for a list)\n" + " select accelerator (kvm, xen, hax, hvf, nvmm, whpx or tcg; use 'help' for a list)\n" " igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n" " kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n" " kvm-shadow-mem=size of KVM shadow MMU in bytes\n" @@ -120,9 +120,9 @@ 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, hvf, whpx 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. +kvm, xen, hax, hvf, nvmm, whpx 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 @item igd-passthru=on|off When Xen is in use, this option controls whether Intel integrated graphics