Skip to content

Commit 74a414a

Browse files
Reinoud Zandijkbonzini
authored andcommitted
Add NVMM accelerator: configure and build logic
Signed-off-by: Kamil Rytarowski <[email protected]> Signed-off-by: Reinoud Zandijk <[email protected]> Message-Id: <[email protected]> [Check for nvmm_vcpu_stop. - Paolo] Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 62cbfdd commit 74a414a

File tree

5 files changed

+30
-5
lines changed

5 files changed

+30
-5
lines changed

accel/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
config WHPX
22
bool
33

4+
config NVMM
5+
bool
6+
47
config HAX
58
bool
69

configure

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ kvm="auto"
352352
hax="auto"
353353
hvf="auto"
354354
whpx="auto"
355+
nvmm="auto"
355356
rdma="$default_feature"
356357
pvrdma="$default_feature"
357358
gprof="no"
@@ -1107,6 +1108,10 @@ for opt do
11071108
;;
11081109
--enable-hvf) hvf="enabled"
11091110
;;
1111+
--disable-nvmm) nvmm="disabled"
1112+
;;
1113+
--enable-nvmm) nvmm="enabled"
1114+
;;
11101115
--disable-whpx) whpx="disabled"
11111116
;;
11121117
--enable-whpx) whpx="enabled"
@@ -1848,6 +1853,7 @@ disabled with --disable-FEATURE, default is enabled if available
18481853
kvm KVM acceleration support
18491854
hax HAX acceleration support
18501855
hvf Hypervisor.framework acceleration support
1856+
nvmm NVMM acceleration support
18511857
whpx Windows Hypervisor Platform acceleration support
18521858
rdma Enable RDMA-based migration
18531859
pvrdma Enable PVRDMA support
@@ -6410,7 +6416,7 @@ NINJA=$ninja $meson setup \
64106416
-Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \
64116417
-Db_lto=$lto -Dcfi=$cfi -Dcfi_debug=$cfi_debug \
64126418
-Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \
6413-
-Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf \
6419+
-Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf -Dnvmm=$nvmm \
64146420
-Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \
64156421
-Dcocoa=$cocoa -Dgtk=$gtk -Dmpath=$mpath -Dsdl=$sdl -Dsdl_image=$sdl_image \
64166422
-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \

meson.build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ if cpu in ['x86', 'x86_64']
8787
accelerator_targets += {
8888
'CONFIG_HAX': ['i386-softmmu', 'x86_64-softmmu'],
8989
'CONFIG_HVF': ['x86_64-softmmu'],
90+
'CONFIG_NVMM': ['i386-softmmu', 'x86_64-softmmu'],
9091
'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
9192
}
9293
endif
@@ -170,6 +171,7 @@ version_res = []
170171
coref = []
171172
iokit = []
172173
emulator_link_args = []
174+
nvmm =not_found
173175
hvf = not_found
174176
if targetos == 'windows'
175177
socket = cc.find_library('ws2_32')
@@ -227,6 +229,14 @@ if not get_option('hax').disabled()
227229
accelerators += 'CONFIG_HAX'
228230
endif
229231
endif
232+
if targetos == 'netbsd'
233+
if cc.has_header_symbol('nvmm.h', 'nvmm_cpu_stop', required: get_option('nvmm'))
234+
nvmm = cc.find_library('nvmm', required: get_option('nvmm'))
235+
endif
236+
if nvmm.found()
237+
accelerators += 'CONFIG_NVMM'
238+
endif
239+
endif
230240

231241
tcg_arch = config_host['ARCH']
232242
if not get_option('tcg').disabled()
@@ -270,6 +280,9 @@ endif
270280
if 'CONFIG_HVF' not in accelerators and get_option('hvf').enabled()
271281
error('HVF not available on this platform')
272282
endif
283+
if 'CONFIG_NVMM' not in accelerators and get_option('nvmm').enabled()
284+
error('NVMM not available on this platform')
285+
endif
273286
if 'CONFIG_WHPX' not in accelerators and get_option('whpx').enabled()
274287
error('WHPX not available on this platform')
275288
endif
@@ -2581,6 +2594,7 @@ if have_system
25812594
summary_info += {'HAX support': config_all.has_key('CONFIG_HAX')}
25822595
summary_info += {'HVF support': config_all.has_key('CONFIG_HVF')}
25832596
summary_info += {'WHPX support': config_all.has_key('CONFIG_WHPX')}
2597+
summary_info += {'NVMM support': config_all.has_key('CONFIG_NVMM')}
25842598
summary_info += {'Xen support': config_host.has_key('CONFIG_XEN_BACKEND')}
25852599
if config_host.has_key('CONFIG_XEN_BACKEND')
25862600
summary_info += {'xen ctrl version': config_host['CONFIG_XEN_CTRL_INTERFACE_VERSION']}

meson_options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ option('whpx', type: 'feature', value: 'auto',
3333
description: 'WHPX acceleration support')
3434
option('hvf', type: 'feature', value: 'auto',
3535
description: 'HVF acceleration support')
36+
option('nvmm', type: 'feature', value: 'auto',
37+
description: 'NVMM acceleration support')
3638
option('xen', type: 'feature', value: 'auto',
3739
description: 'Xen backend support')
3840
option('xen_pci_passthrough', type: 'feature', value: 'auto',

qemu-options.hx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \
2626
"-machine [type=]name[,prop[=value][,...]]\n"
2727
" selects emulated machine ('-machine help' for list)\n"
2828
" property accel=accel1[:accel2[:...]] selects accelerator\n"
29-
" supported accelerators are kvm, xen, hax, hvf, whpx or tcg (default: tcg)\n"
29+
" supported accelerators are kvm, xen, hax, hvf, nvmm, whpx or tcg (default: tcg)\n"
3030
" vmport=on|off|auto controls emulation of vmport (default: auto)\n"
3131
" dump-guest-core=on|off include guest memory in a core dump (default=on)\n"
3232
" mem-merge=on|off controls memory merge support (default: on)\n"
@@ -58,7 +58,7 @@ SRST
5858

5959
``accel=accels1[:accels2[:...]]``
6060
This is used to enable an accelerator. Depending on the target
61-
architecture, kvm, xen, hax, hvf, whpx or tcg can be available.
61+
architecture, kvm, xen, hax, hvf, nvmm, whpx or tcg can be available.
6262
By default, tcg is used. If there is more than one accelerator
6363
specified, the next one is used if the previous one fails to
6464
initialize.
@@ -135,7 +135,7 @@ ERST
135135

136136
DEF("accel", HAS_ARG, QEMU_OPTION_accel,
137137
"-accel [accel=]accelerator[,prop[=value][,...]]\n"
138-
" select accelerator (kvm, xen, hax, hvf, whpx or tcg; use 'help' for a list)\n"
138+
" select accelerator (kvm, xen, hax, hvf, nvmm, whpx or tcg; use 'help' for a list)\n"
139139
" igd-passthru=on|off (enable Xen integrated Intel graphics passthrough, default=off)\n"
140140
" kernel-irqchip=on|off|split controls accelerated irqchip support (default=on)\n"
141141
" kvm-shadow-mem=size of KVM shadow MMU in bytes\n"
@@ -145,7 +145,7 @@ DEF("accel", HAS_ARG, QEMU_OPTION_accel,
145145
SRST
146146
``-accel name[,prop=value[,...]]``
147147
This is used to enable an accelerator. Depending on the target
148-
architecture, kvm, xen, hax, hvf, whpx or tcg can be available. By
148+
architecture, kvm, xen, hax, hvf, nvmm, whpx or tcg can be available. By
149149
default, tcg is used. If there is more than one accelerator
150150
specified, the next one is used if the previous one fails to
151151
initialize.

0 commit comments

Comments
 (0)