diff mbox series

[v2,2/4] Add the NetBSD Virtual Machine Monitor accelerator.

Message ID 20200128140945.929-3-n54@gmx.com
State New
Headers show
Series [v2,1/4] Add the NVMM vcpu API | expand

Commit Message

Kamil Rytarowski Jan. 28, 2020, 2:09 p.m. UTC
From: Maxime Villard <max@m00nbsd.net>

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 <max@m00nbsd.net>
Signed-off-by: Kamil Rytarowski <n54@gmx.com>
Reviewed-by: Sergio Lopez <slp@redhat.com>
---
 configure       | 36 ++++++++++++++++++++++++++++++++++++
 qemu-options.hx | 16 ++++++++--------
 2 files changed, 44 insertions(+), 8 deletions(-)

--
2.24.1

Comments

Philippe Mathieu-Daudé Feb. 3, 2020, 11:41 a.m. UTC | #1
On 1/28/20 3:09 PM, Kamil Rytarowski wrote:
> From: Maxime Villard <max@m00nbsd.net>
> 
> 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 <max@m00nbsd.net>
> Signed-off-by: Kamil Rytarowski <n54@gmx.com>
> Reviewed-by: Sergio Lopez <slp@redhat.com>
> ---
>   configure       | 36 ++++++++++++++++++++++++++++++++++++
>   qemu-options.hx | 16 ++++++++--------
>   2 files changed, 44 insertions(+), 8 deletions(-)
> 
> 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
> 

Maybe you can add something like:

if test "$targetos" = "NetBSD"; then
     nvmm="check"
fi

to build by default with NVMM if available.

> +##########################################
> +# 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
> --
> 2.24.1
> 

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Kamil Rytarowski Feb. 3, 2020, 11:56 a.m. UTC | #2
On 03.02.2020 12:41, Philippe Mathieu-Daudé wrote:
>> @@ -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
>>
> 
> Maybe you can add something like:
> 
> if test "$targetos" = "NetBSD"; then
>     nvmm="check"
> fi
> 
> to build by default with NVMM if available.

I will add nvmm=yes to the NetBSD) targetos check section.
Philippe Mathieu-Daudé Feb. 3, 2020, 12:10 p.m. UTC | #3
On 2/3/20 12:56 PM, Kamil Rytarowski wrote:
> On 03.02.2020 12:41, Philippe Mathieu-Daudé wrote:
>>> @@ -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
>>>
>>
>> Maybe you can add something like:
>>
>> if test "$targetos" = "NetBSD"; then
>>      nvmm="check"
>> fi
>>
>> to build by default with NVMM if available.
> 
> I will add nvmm=yes to the NetBSD) targetos check section.

Ah yes, clever :)
Paolo Bonzini March 2, 2020, 5:11 p.m. UTC | #4
On 03/02/20 12:41, Philippe Mathieu-Daudé wrote:
> 
> Maybe you can add something like:
> 
> if test "$targetos" = "NetBSD"; then
>     nvmm="check"
> fi

You could do just nvmm="" and, below,

if test "$nvmm" != "no" && test "$targetos" = "NetBSD"

But maybe even testing NetBSD is not needed since nvmm.h will likely not
be there.

Paolo

> to build by default with NVMM if available.
> 
>> +##########################################
>> +# 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
Paolo Bonzini March 2, 2020, 5:12 p.m. UTC | #5
On 03/02/20 12:56, Kamil Rytarowski wrote:
> On 03.02.2020 12:41, Philippe Mathieu-Daudé wrote:
>>> @@ -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
>>>
>>
>> Maybe you can add something like:
>>
>> if test "$targetos" = "NetBSD"; then
>>     nvmm="check"
>> fi
>>
>> to build by default with NVMM if available.
> 
> I will add nvmm=yes to the NetBSD) targetos check section.

No, nvmm=yes instead should fail the build if nvmm.h is not available.
That is not a good default.

Paolo
Kamil Rytarowski March 2, 2020, 6:05 p.m. UTC | #6
On 02.03.2020 18:12, Paolo Bonzini wrote:
> On 03/02/20 12:56, Kamil Rytarowski wrote:
>> On 03.02.2020 12:41, Philippe Mathieu-Daudé wrote:
>>>> @@ -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
>>>>
>>>
>>> Maybe you can add something like:
>>>
>>> if test "$targetos" = "NetBSD"; then
>>>     nvmm="check"
>>> fi
>>>
>>> to build by default with NVMM if available.
>>
>> I will add nvmm=yes to the NetBSD) targetos check section.
>
> No, nvmm=yes instead should fail the build if nvmm.h is not available.
> That is not a good default.
>
> Paolo
>
>

Most users will get nvmm.h in place now and this is still a tunable.

I have got no opinion what to put there, nvmm=check still works.

diff --git a/configure b/configure
index d4a837cf9d..b3560d88bb 100755
--- a/configure
+++ b/configure
@@ -836,7 +836,7 @@ DragonFly)
 NetBSD)
   bsd="yes"
   hax="yes"
-  nvmm="yes"
+  nvmm="check"
   make="${MAKE-gmake}"
   audio_drv_list="oss try-sdl"
   audio_possible_drivers="oss sdl"
Kamil Rytarowski March 2, 2020, 6:09 p.m. UTC | #7
On 02.03.2020 18:11, Paolo Bonzini wrote:
> On 03/02/20 12:41, Philippe Mathieu-Daudé wrote:
>>
>> Maybe you can add something like:
>>
>> if test "$targetos" = "NetBSD"; then
>>     nvmm="check"
>> fi
>
> You could do just nvmm="" and, below,
>
> if test "$nvmm" != "no" && test "$targetos" = "NetBSD"
>
> But maybe even testing NetBSD is not needed since nvmm.h will likely not
> be there.
>
> Paolo
>

I have got no opinion here.

I can just change on request nvmm="yes" to nvmm="check" and be done.

>> to build by default with NVMM if available.
>>
>>> +##########################################
>>> +# 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
>
Maxime Villard March 2, 2020, 7:14 p.m. UTC | #8
Le 02/03/2020 à 19:05, Kamil Rytarowski a écrit :
> On 02.03.2020 18:12, Paolo Bonzini wrote:
>> On 03/02/20 12:56, Kamil Rytarowski wrote:
>>> On 03.02.2020 12:41, Philippe Mathieu-Daudé wrote:
>>>>> @@ -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
>>>>>
>>>>
>>>> Maybe you can add something like:
>>>>
>>>> if test "$targetos" = "NetBSD"; then
>>>>     nvmm="check"
>>>> fi
>>>>
>>>> to build by default with NVMM if available.
>>>
>>> I will add nvmm=yes to the NetBSD) targetos check section.
>>
>> No, nvmm=yes instead should fail the build if nvmm.h is not available.
>> That is not a good default.
>>
>> Paolo
>>
>>
> 
> Most users will get nvmm.h in place now and this is still a tunable.
> 
> I have got no opinion what to put there, nvmm=check still works.

I would keep "yes", for consistency with the other entries. Changing all
entries to "check" should be done in a separate commit, unrelated to
NVMM.

> diff --git a/configure b/configure
> index d4a837cf9d..b3560d88bb 100755
> --- a/configure
> +++ b/configure
> @@ -836,7 +836,7 @@ DragonFly)
>  NetBSD)
>    bsd="yes"
>    hax="yes"
> -  nvmm="yes"
> +  nvmm="check"
>    make="${MAKE-gmake}"
>    audio_drv_list="oss try-sdl"
>    audio_possible_drivers="oss sdl"
>
Paolo Bonzini March 2, 2020, 7:40 p.m. UTC | #9
Il lun 2 mar 2020, 20:14 Maxime Villard <max@m00nbsd.net> ha scritto:

> Le 02/03/2020 à 19:05, Kamil Rytarowski a écrit :
> > On 02.03.2020 18:12, Paolo Bonzini wrote:
> >> On 03/02/20 12:56, Kamil Rytarowski wrote:
> >>> On 03.02.2020 12:41, Philippe Mathieu-Daudé wrote:
> >>>>> @@ -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
> >>>>>
> >>>>
> >>>> Maybe you can add something like:
> >>>>
> >>>> if test "$targetos" = "NetBSD"; then
> >>>>     nvmm="check"
> >>>> fi
> >>>>
> >>>> to build by default with NVMM if available.
> >>>
> >>> I will add nvmm=yes to the NetBSD) targetos check section.
> >>
> >> No, nvmm=yes instead should fail the build if nvmm.h is not available.
> >> That is not a good default.
> >>
> >> Paolo
> >>
> >>
> >
> > Most users will get nvmm.h in place now and this is still a tunable.
> >
> > I have got no opinion what to put there, nvmm=check still works.
>
> I would keep "yes", for consistency with the other entries. Changing all
> entries to "check" should be done in a separate commit, unrelated to
> NVMM.
>

The difference is that KVM for example does not need external includes or
libraries.

Paolo


> > diff --git a/configure b/configure
> > index d4a837cf9d..b3560d88bb 100755
> > --- a/configure
> > +++ b/configure
> > @@ -836,7 +836,7 @@ DragonFly)
> >  NetBSD)
> >    bsd="yes"
> >    hax="yes"
> > -  nvmm="yes"
> > +  nvmm="check"
> >    make="${MAKE-gmake}"
> >    audio_drv_list="oss try-sdl"
> >    audio_possible_drivers="oss sdl"
> >
>
>
Kamil Rytarowski March 2, 2020, 9:10 p.m. UTC | #10
On 02.03.2020 20:40, Paolo Bonzini wrote:
>
>
> Il lun 2 mar 2020, 20:14 Maxime Villard <max@m00nbsd.net
> <mailto:max@m00nbsd.net>> ha scritto:
>
>     Le 02/03/2020 à 19:05, Kamil Rytarowski a écrit :
>     > On 02.03.2020 18:12, Paolo Bonzini wrote:
>     >> On 03/02/20 12:56, Kamil Rytarowski wrote:
>     >>> On 03.02.2020 12:41, Philippe Mathieu-Daudé wrote:
>     >>>>> @@ -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
>     >>>>>
>     >>>>
>     >>>> Maybe you can add something like:
>     >>>>
>     >>>> if test "$targetos" = "NetBSD"; then
>     >>>>     nvmm="check"
>     >>>> fi
>     >>>>
>     >>>> to build by default with NVMM if available.
>     >>>
>     >>> I will add nvmm=yes to the NetBSD) targetos check section.
>     >>
>     >> No, nvmm=yes instead should fail the build if nvmm.h is not
>     available.
>     >> That is not a good default.
>     >>
>     >> Paolo
>     >>
>     >>
>     >
>     > Most users will get nvmm.h in place now and this is still a tunable.
>     >
>     > I have got no opinion what to put there, nvmm=check still works.
>
>     I would keep "yes", for consistency with the other entries. Changing all
>     entries to "check" should be done in a separate commit, unrelated to
>     NVMM.
>
>
> The difference is that KVM for example does not need external includes
> or libraries.
>
> Paolo
>

We don't support this scenario and after a year there might be no
supported release without NVMM.

The only concern is about using qemu on !amd64, but we have there not
many users of qemu for understandable reasons.

For AArch64 we plan to implement a dedicated NVMM backend.

>
>     > diff --git a/configure b/configure
>     > index d4a837cf9d..b3560d88bb 100755
>     > --- a/configure
>     > +++ b/configure
>     > @@ -836,7 +836,7 @@ DragonFly)
>     >  NetBSD)
>     >    bsd="yes"
>     >    hax="yes"
>     > -  nvmm="yes"
>     > +  nvmm="check"
>     >    make="${MAKE-gmake}"
>     >    audio_drv_list="oss try-sdl"
>     >    audio_possible_drivers="oss sdl"
>     >
>
Paolo Bonzini March 2, 2020, 10:45 p.m. UTC | #11
Il lun 2 mar 2020, 22:11 Kamil Rytarowski <n54@gmx.com> ha scritto:

> > The difference is that KVM for example does not need external includes
> > or libraries.
>

We don't support this scenario


What scenario?

and after a year there might be no
> supported release without NVMM.
>
> The only concern is about using qemu on !amd64, but we have there not
> many users of qemu for understandable reasons.
>

How do you know?

Paolo


> For AArch64 we plan to implement a dedicated NVMM backend.
>
> >
> >     > diff --git a/configure b/configure
> >     > index d4a837cf9d..b3560d88bb 100755
> >     > --- a/configure
> >     > +++ b/configure
> >     > @@ -836,7 +836,7 @@ DragonFly)
> >     >  NetBSD)
> >     >    bsd="yes"
> >     >    hax="yes"
> >     > -  nvmm="yes"
> >     > +  nvmm="check"
> >     >    make="${MAKE-gmake}"
> >     >    audio_drv_list="oss try-sdl"
> >     >    audio_possible_drivers="oss sdl"
> >     >
> >
>
>
diff mbox series

Patch

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