From patchwork Thu Feb 6 11:57:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kamil Rytarowski X-Patchwork-Id: 11368317 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B46BB921 for ; Thu, 6 Feb 2020 12:07:49 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5B69120730 for ; Thu, 6 Feb 2020 12:07:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="cUySjoBh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B69120730 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:37520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfwi-0007pt-4e for patchwork-qemu-devel@patchwork.kernel.org; Thu, 06 Feb 2020 07:07:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56309) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izfnt-0001eV-Dg for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:58:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izfnq-0008AP-UP for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:58:41 -0500 Received: from mout.gmx.net ([212.227.17.20]:60429) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izfnq-00080b-Kc for qemu-devel@nongnu.org; Thu, 06 Feb 2020 06:58:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1580990305; bh=ZNzSTgefsmT4t6kYtxFfI2fVCTMCQzFdLp9kloQNlvY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=cUySjoBhBFLZVZp1KnLaQOX6i1NupNV+DeNXVL4uiwhci0f6iZcrcG+tVeJd1anGY VxM+FLQ0J14Whih53DEBQj3i5SkOtPrhii2o1ggbZ/1plqE+jomgKfuAWqGfjkLSS5 WuodLQGi0VyjkCCyB12mcJ7Bw6byebAlKjIQI2a8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([89.71.135.231]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1M59C8-1j0ljJ2ftU-0016lN; Thu, 06 Feb 2020 12:58:25 +0100 From: Kamil Rytarowski To: rth@twiddle.net, ehabkost@redhat.com, slp@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, philmd@redhat.com, max@m00nbsd.net Subject: [PATCH v3 2/4] Add the NetBSD Virtual Machine Monitor accelerator. Date: Thu, 6 Feb 2020 12:57:29 +0100 Message-Id: <20200206115731.13552-3-n54@gmx.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200206115731.13552-1-n54@gmx.com> References: <20200128140945.929-1-n54@gmx.com> <20200206115731.13552-1-n54@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:Z/kpdlzIujssXysYlXQP+N1V9a/Emqjzxsv8gRXK0/xd3oGHX8Z xP7QEUN1X8Exo2sUejYVmFyCchLDLrLyMo0f7/hSKaIM9KROjhmKCKVS5w2wBqYbjCf4vLL 9RUCAI68xkBsVjbzpi6wSn/TcPn8udxbcN8KDtvFq2LEzGR5JSQRtUe4gIpo4Urky34QVxx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qIet931McqLVp6Skb0mL0aKqYDd0i83U CX8Zm1fNrEW+tfWrHi2xLa3qzickMHNEoDFYxUMMc+KhOkWPr4qMeOa9NKQX7nwSdnVBFpeQQ QyQlpOhyEEqepkp6KcI5/EQ6wIJ2tMLPAp3wYK+XcE5PsPTJ4oMjUHXrAYAPJzG5l6FI7iFfe z+YO2U1bT9U2fFwVxRRrZ6j30V3ZsSaetF7wxDgqD4yLJkT/EYsYds4unwUa0y/LGq588= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 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+patchwork-qemu-devel=patchwork.kernel.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 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Jared McNeill --- configure | 37 +++++++++++++++++++++++++++++++++++++ qemu-options.hx | 16 ++++++++-------- 2 files changed, 45 insertions(+), 8 deletions(-) -- 2.25.0 diff --git a/configure b/configure index 115dc38085..d4a837cf9d 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 } @@ -388,6 +400,7 @@ kvm="no" hax="no" hvf="no" whpx="no" +nvmm="no" rdma="" pvrdma="" gprof="no" @@ -823,6 +836,7 @@ DragonFly) NetBSD) bsd="yes" hax="yes" + nvmm="yes" make="${MAKE-gmake}" audio_drv_list="oss try-sdl" audio_possible_drivers="oss sdl" @@ -1169,6 +1183,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" @@ -1773,6 +1791,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 @@ -2764,6 +2783,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 @@ -6543,6 +6576,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" @@ -7828,6 +7862,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 224a8e8712..10c046c916 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" @@ -64,9 +64,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 @@ -114,7 +114,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" @@ -124,9 +124,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