From patchwork Tue Aug 11 13:01:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kamil Rytarowski X-Patchwork-Id: 11709237 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 D972A13B1 for ; Tue, 11 Aug 2020 13:25:39 +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 AE76E20658 for ; Tue, 11 Aug 2020 13:25:39 +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="K7DEz6FR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE76E20658 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]:52186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5UHa-00036s-LC for patchwork-qemu-devel@patchwork.kernel.org; Tue, 11 Aug 2020 09:25:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5Tw2-00009H-VH for qemu-devel@nongnu.org; Tue, 11 Aug 2020 09:03:22 -0400 Received: from mout.gmx.net ([212.227.15.18]:53981) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5Tw0-0000wY-MH for qemu-devel@nongnu.org; Tue, 11 Aug 2020 09:03:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1597150993; bh=ZKmjV+nVw1aJ6gZD2QzOEI785zynAMn0St417dViqGo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=K7DEz6FRRd0Tq/ninwHrZLaPLNnIPIlWmu3hS0ZPt+TmLy1EZL+paj9dp2gOyduOg t006qn60SMG6wB3k7lm6VuOjsNE/W163DeDYhZhpuwWEL9zqoiNsxS8si47N4UyPjZ pv2W4yAZkcGqA9njnXsA0n9mFxgrwEGf1czWIPFA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([89.79.191.25]) by mail.gmx.com (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1Msq2E-1kyQ2L0Ehc-00tCye; Tue, 11 Aug 2020 15:03:13 +0200 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, jmcneill@invisible.ca Subject: [PATCH v5 2/4] Add the NetBSD Virtual Machine Monitor accelerator. Date: Tue, 11 Aug 2020 15:01:51 +0200 Message-Id: <20200811130153.4948-2-n54@gmx.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200811130153.4948-1-n54@gmx.com> References: <20200206213232.1918-2-n54@gmx.com> <20200811130153.4948-1-n54@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:5BOdXnJPvmwV9SRxtIJqAsCk02FdnU78VuEDhPMPTzqvSqJE9m7 aSv9Rao6GL44in2noDbfJ1NJYcKBVNst1EiwJmgLkI8EnYrgTj6+ar5Jfap1VSwZgVqYe8D LRfbmF+ZQrH+00iU04kh5i3evY6/UVTQK8+UvZ6i0PpsVQxVl7t1y6uLkFh4lsU1HiPHZjr 3w/ko9rgAU5EV2i90l6TQ== X-UI-Out-Filterresults: notjunk:1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UdniiwU87pYa NqZVQehKqEFLFl0KMzT6kQZtEO7UdBKi9cqpMKX0uiy8norRpyNX+MUyIJEBdLbGvt4eUybMw n4GxhIfdy51U1rKt82sb+AdjUJLBfNExRfclrGUE+ocGJYoDuO772KsB9ocY6gjmZ/WstNi5j xLIOZ/E4zQ/B+o0qGN0FSf8FlySnShu3b/Njoqrcz9W87LjIOgwSDcZ1HNQiA92BAFQ4BrlA7 x2AgQ/fpF40454+z4UOYF+dqGaG2YFzNnLAHyVrPr6U6Hs79Jk8KcIB+yqOz5z6iCs/aKODV+ edftvSuawVn2l25skbTKtHoqfuN4e1czrCVbLZIgp3QFOkBuzAU4DwLHkw6h8cgfc8t/n+iJE ZH4ejKxE9Dqf2podvTefRWcXbGzBBIf8U/9j0v6So8FEzWOTtCeszZhZ++636Q1wAk4E0DqL3 7eYzrZYv9D7OA2jw6AcqWHuI/LjJqCR+TAT2Rl4+KqR3uubOBHmjYi/7Uhq8lpkg8FN1rOuX4 mAkF5TSaFjKNjnT08viIzykQ= Received-SPF: pass client-ip=212.227.15.18; envelope-from=n54@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/11 09:02:59 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 11 Aug 2020 09:13:33 -0400 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 | 10 +++++----- 2 files changed, 42 insertions(+), 5 deletions(-) -- 2.28.0 diff --git a/configure b/configure index 2acc4d1465..fb9ffba2bf 100755 --- a/configure +++ b/configure @@ -246,6 +246,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) @@ -273,6 +284,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 } @@ -395,6 +407,7 @@ kvm="no" hax="no" hvf="no" whpx="no" +nvmm="no" rdma="" pvrdma="" gprof="no" @@ -847,6 +860,7 @@ DragonFly) NetBSD) bsd="yes" hax="yes" + nvmm="yes" make="${MAKE-gmake}" audio_drv_list="oss try-sdl" audio_possible_drivers="oss sdl" @@ -1233,6 +1247,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" @@ -1879,6 +1897,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 @@ -2965,6 +2984,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 @@ -6934,6 +6967,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" @@ -8332,6 +8366,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 708583b4ce..697accaa7e 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -26,7 +26,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" @@ -58,7 +58,7 @@ SRST ``accel=accels1[:accels2[:...]]`` This is used to enable an accelerator. Depending on the target - architecture, kvm, xen, hax, hvf, whpx or tcg can be available. + architecture, 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. @@ -119,7 +119,7 @@ ERST 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" @@ -128,8 +128,8 @@ DEF("accel", HAS_ARG, QEMU_OPTION_accel, SRST ``-accel name[,prop=value[,...]]`` 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 + architecture, 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.