From nobody Thu Nov 13 07:36:15 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1617812559; cv=none; d=zohomail.com; s=zohoarc; b=D7pwJEixVgK//9WcR+odN9effITHNxYnsuJErlocv+UM6nWg1C3/HxYEO2fztq73llAfF0BGD3qzLIndlOCBbbhjsdfNLQ/1DwLNg2AyBTA8pHi14tJm6I4dmvVrvJPrplH7oHHhZ7OmF6UMZ2j2ij/cTKy/V8rBqLLhiHZLUPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617812559; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5FQSrPGllAEl7HF7+leJ1TVde8yD6kZ8ivaEYgyQIOc=; b=GBek8RiW/h5YgIZUuZk8paMWD7el/AnpA+dkq0oC+IcaUAkk1e4aPO/QGUoFqUINbJVobomKFu565nIF1K6UmY4coENavmE7aQc/Bs6jAAUcKpgxzxXOClZOTtZ/ah06XfzupeXp9HFSWyFbOTCJX0kvQQb7cDou8Pb2kAbMt0k= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617812559196366.66663102542054; Wed, 7 Apr 2021 09:22:39 -0700 (PDT) Received: from localhost ([::1]:35122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUAwv-0007ei-Pk for importer@patchew.org; Wed, 07 Apr 2021 12:22:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUArP-0004AN-Gi for qemu-devel@nongnu.org; Wed, 07 Apr 2021 12:16:56 -0400 Received: from 13thmonkey.org ([80.100.255.32]:65422 helo=gorilla.13thmonkey.org) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUArL-0000oO-Iv for qemu-devel@nongnu.org; Wed, 07 Apr 2021 12:16:54 -0400 Received: by gorilla.13thmonkey.org (Postfix, from userid 103) id 9B6EA2FF0793; Wed, 7 Apr 2021 16:16:45 +0000 (UTC) From: Reinoud Zandijk To: qemu-devel@nongnu.org Subject: [PATCH v8 1/4] Add NVMM accelerator: configure and build logic Date: Wed, 7 Apr 2021 16:16:28 +0000 Message-Id: <20210407161631.1780-2-reinoud@NetBSD.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407161631.1780-1-reinoud@NetBSD.org> References: <20210407161631.1780-1-reinoud@NetBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=80.100.255.32; envelope-from=reinoud@gorilla.13thmonkey.org; helo=gorilla.13thmonkey.org X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: Eduardo Habkost , Richard Henderson , Kamil Rytarowski , Reinoud Zandijk , Paolo Bonzini , Ryo ONODERA Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Kamil Rytarowski Signed-off-by: Reinoud Zandijk --- accel/Kconfig | 3 +++ configure | 8 +++++++- meson.build | 14 ++++++++++++++ meson_options.txt | 2 ++ qemu-options.hx | 8 ++++---- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/accel/Kconfig b/accel/Kconfig index 461104c771..8bdedb7d15 100644 --- a/accel/Kconfig +++ b/accel/Kconfig @@ -1,6 +1,9 @@ config WHPX bool =20 +config NVMM + bool + config HAX bool =20 diff --git a/configure b/configure index 535e6a9269..0ca736df47 100755 --- a/configure +++ b/configure @@ -352,6 +352,7 @@ kvm=3D"auto" hax=3D"auto" hvf=3D"auto" whpx=3D"auto" +nvmm=3D"auto" rdma=3D"$default_feature" pvrdma=3D"$default_feature" gprof=3D"no" @@ -1107,6 +1108,10 @@ for opt do ;; --enable-hvf) hvf=3D"enabled" ;; + --disable-nvmm) nvmm=3D"disabled" + ;; + --enable-nvmm) nvmm=3D"enabled" + ;; --disable-whpx) whpx=3D"disabled" ;; --enable-whpx) whpx=3D"enabled" @@ -1848,6 +1853,7 @@ disabled with --disable-FEATURE, default is enabled i= f available kvm KVM acceleration support hax HAX acceleration support hvf Hypervisor.framework acceleration support + nvmm NVMM acceleration support whpx Windows Hypervisor Platform acceleration support rdma Enable RDMA-based migration pvrdma Enable PVRDMA support @@ -6410,7 +6416,7 @@ NINJA=3D$ninja $meson setup \ -Db_coverage=3D$(if test "$gcov" =3D yes; then echo true; else ech= o false; fi) \ -Db_lto=3D$lto -Dcfi=3D$cfi -Dcfi_debug=3D$cfi_debug \ -Dmalloc=3D$malloc -Dmalloc_trim=3D$malloc_trim -Dsparse=3D$sparse= \ - -Dkvm=3D$kvm -Dhax=3D$hax -Dwhpx=3D$whpx -Dhvf=3D$hvf \ + -Dkvm=3D$kvm -Dhax=3D$hax -Dwhpx=3D$whpx -Dhvf=3D$hvf -Dnvmm=3D$nv= mm \ -Dxen=3D$xen -Dxen_pci_passthrough=3D$xen_pci_passthrough -Dtcg=3D= $tcg \ -Dcocoa=3D$cocoa -Dgtk=3D$gtk -Dmpath=3D$mpath -Dsdl=3D$sdl -Dsdl_= image=3D$sdl_image \ -Dvnc=3D$vnc -Dvnc_sasl=3D$vnc_sasl -Dvnc_jpeg=3D$vnc_jpeg -Dvnc_p= ng=3D$vnc_png \ diff --git a/meson.build b/meson.build index c6f4b0cf5e..14dd3fe068 100644 --- a/meson.build +++ b/meson.build @@ -87,6 +87,7 @@ if cpu in ['x86', 'x86_64'] accelerator_targets +=3D { 'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'], 'CONFIG_HVF': ['x86_64-softmmu'], + 'CONFIG_NVMM': ['i386-softmmu', 'x86_64-softmmu'], 'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'], } endif @@ -170,6 +171,7 @@ version_res =3D [] coref =3D [] iokit =3D [] emulator_link_args =3D [] +nvmm =3Dnot_found hvf =3D not_found if targetos =3D=3D 'windows' socket =3D cc.find_library('ws2_32') @@ -227,6 +229,14 @@ if not get_option('hax').disabled() accelerators +=3D 'CONFIG_HAX' endif endif +if targetos =3D=3D 'netbsd' + if cc.has_header('nvmm.h', required: get_option('nvmm')) + nvmm =3D cc.find_library('nvmm', required: get_option('nvmm')) + endif + if nvmm.found() + accelerators +=3D 'CONFIG_NVMM' + endif +endif =20 tcg_arch =3D config_host['ARCH'] if not get_option('tcg').disabled() @@ -271,6 +281,9 @@ endif if 'CONFIG_HVF' not in accelerators and get_option('hvf').enabled() error('HVF not available on this platform') endif +if 'CONFIG_NVMM' not in accelerators and get_option('nvmm').enabled() + error('NVMM not available on this platform') +endif if 'CONFIG_WHPX' not in accelerators and get_option('whpx').enabled() error('WHPX not available on this platform') endif @@ -2576,6 +2589,7 @@ if have_system summary_info +=3D {'HAX support': config_all.has_key('CONFIG_HAX')} summary_info +=3D {'HVF support': config_all.has_key('CONFIG_HVF')} summary_info +=3D {'WHPX support': config_all.has_key('CONFIG_WHPX'= )} + summary_info +=3D {'NVMM support': config_all.has_key('CONFIG_NVMM'= )} summary_info +=3D {'Xen support': config_host.has_key('CONFIG_XEN_= BACKEND')} if config_host.has_key('CONFIG_XEN_BACKEND') summary_info +=3D {'xen ctrl version': config_host['CONFIG_XEN_CTRL_I= NTERFACE_VERSION']} diff --git a/meson_options.txt b/meson_options.txt index 9734019995..91034420a1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -33,6 +33,8 @@ option('whpx', type: 'feature', value: 'auto', description: 'WHPX acceleration support') option('hvf', type: 'feature', value: 'auto', description: 'HVF acceleration support') +option('nvmm', type: 'feature', value: 'auto', + description: 'NVMM acceleration support') option('xen', type: 'feature', value: 'auto', description: 'Xen backend support') option('xen_pci_passthrough', type: 'feature', value: 'auto', diff --git a/qemu-options.hx b/qemu-options.hx index fd21002bd6..dadf11fae9 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -26,7 +26,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ "-machine [type=3D]name[,prop[=3Dvalue][,...]]\n" " selects emulated machine ('-machine help' for list)\n" " property accel=3Daccel1[:accel2[:...]] selects accele= rator\n" - " supported accelerators are kvm, xen, hax, hvf, whpx o= r tcg (default: tcg)\n" + " supported accelerators are kvm, xen, hax, hvf, nvmm, = whpx or tcg (default: tcg)\n" " vmport=3Don|off|auto controls emulation of vmport (de= fault: auto)\n" " dump-guest-core=3Don|off include guest memory in a co= re dump (default=3Don)\n" " mem-merge=3Don|off controls memory merge support (def= ault: on)\n" @@ -58,7 +58,7 @@ SRST =20 ``accel=3Daccels1[: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 availab= le. 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. @@ -135,7 +135,7 @@ ERST =20 DEF("accel", HAS_ARG, QEMU_OPTION_accel, "-accel [accel=3D]accelerator[,prop[=3Dvalue][,...]]\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=3Don|off (enable Xen integrated Intel gr= aphics passthrough, default=3Doff)\n" " kernel-irqchip=3Don|off|split controls accelerated ir= qchip support (default=3Don)\n" " kvm-shadow-mem=3Dsize of KVM shadow MMU in bytes\n" @@ -145,7 +145,7 @@ DEF("accel", HAS_ARG, QEMU_OPTION_accel, SRST ``-accel name[,prop=3Dvalue[,...]]`` This is used to enable an accelerator. Depending on the target - architecture, kvm, xen, hax, hvf, whpx or tcg can be available. By + 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. --=20 2.31.1