diff mbox series

[1/6] Add the Android Emulator hypervisor driver (AEHD) accelerator.

Message ID 20230303022618.4098825-1-hshan@google.com
State New
Headers show
Series Adding the Android Emulator hypervisor driver accelerator | expand

Commit Message

Haitao Shan March 3, 2023, 2:26 a.m. UTC
Add the configure support for the Android Emulator hypervisor driver
accelerator. The Android Emulator hypervisor driver is a Windows
driver made by porting the KVM from kernel 4.9-rc7.

Signed-off-by: Haitao Shan <hshan@google.com>
---
 accel/Kconfig                  |  3 +++
 docs/about/build-platforms.rst |  2 +-
 include/exec/poison.h          |  1 +
 meson.build                    | 16 ++++++++++++++++
 meson_options.txt              |  2 ++
 qemu-options.hx                | 20 ++++++++++----------
 scripts/meson-buildoptions.sh  |  2 ++
 7 files changed, 35 insertions(+), 11 deletions(-)

Comments

Michael S. Tsirkin March 3, 2023, 7:33 a.m. UTC | #1
On Thu, Mar 02, 2023 at 06:26:12PM -0800, Haitao Shan wrote:
> Add the configure support for the Android Emulator hypervisor driver
> accelerator. The Android Emulator hypervisor driver is a Windows
> driver made by porting the KVM from kernel 4.9-rc7.
> 
> Signed-off-by: Haitao Shan <hshan@google.com>

Replying on patch 1 but it applies to the whole patchset.

There's obvious duplication with kvm here - probably not surprising.

I'd be interested to hear from KVM people to know whether
there's interest in unifying code, or they would rather
not bother supporting this platform and it's better off
being kept separate.

> ---
>  accel/Kconfig                  |  3 +++
>  docs/about/build-platforms.rst |  2 +-
>  include/exec/poison.h          |  1 +
>  meson.build                    | 16 ++++++++++++++++
>  meson_options.txt              |  2 ++
>  qemu-options.hx                | 20 ++++++++++----------
>  scripts/meson-buildoptions.sh  |  2 ++
>  7 files changed, 35 insertions(+), 11 deletions(-)
> 
> diff --git a/accel/Kconfig b/accel/Kconfig
> index 8bdedb7d15..187d8f6acf 100644
> --- a/accel/Kconfig
> +++ b/accel/Kconfig
> @@ -16,6 +16,9 @@ config TCG
>  config KVM
>      bool
>  
> +config AEHD
> +    bool
> +
>  config XEN
>      bool
>      select FSDEV_9P if VIRTFS
> diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> index 20b97c3310..184707bd62 100644
> --- a/docs/about/build-platforms.rst
> +++ b/docs/about/build-platforms.rst
> @@ -52,7 +52,7 @@ Those hosts are officially supported, with various accelerators:
>     * - SPARC
>       - tcg
>     * - x86
> -     - hax, hvf (64 bit only), kvm, nvmm, tcg, whpx (64 bit only), xen
> +     - aehd (64 bit only), hax, hvf (64 bit only), kvm, nvmm, tcg, whpx (64 bit only), xen
>  
>  Other host architectures are not supported. It is possible to build QEMU system
>  emulation on an unsupported host architecture using the configure
> diff --git a/include/exec/poison.h b/include/exec/poison.h
> index 140daa4a85..cb851744d1 100644
> --- a/include/exec/poison.h
> +++ b/include/exec/poison.h
> @@ -86,6 +86,7 @@
>  #pragma GCC poison CONFIG_HVF
>  #pragma GCC poison CONFIG_LINUX_USER
>  #pragma GCC poison CONFIG_KVM
> +#pragma GCC poison CONFIG_AEHD
>  #pragma GCC poison CONFIG_SOFTMMU
>  #pragma GCC poison CONFIG_WHPX
>  #pragma GCC poison CONFIG_XEN
> diff --git a/meson.build b/meson.build
> index 77d2ae87e4..f2b049ceac 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -146,6 +146,11 @@ if cpu in ['x86', 'x86_64']
>      'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
>    }
>  endif
> +if cpu in ['x86_64']
> +  accelerator_targets += {
> +    'CONFIG_AEHD': ['i386-softmmu', 'x86_64-softmmu'],
> +  }
> +endif
>  
>  modular_tcg = []
>  # Darwin does not support references to thread-local variables in modules
> @@ -421,6 +426,13 @@ accelerators = []
>  if get_option('kvm').allowed() and targetos == 'linux'
>    accelerators += 'CONFIG_KVM'
>  endif
> +if get_option('aehd').allowed() and targetos == 'windows'
> +  if get_option('aehd').enabled() and host_machine.cpu() != 'x86_64'
> +    error('AEHD requires 64-bit host')
> +  else
> +    accelerators += 'CONFIG_AEHD'
> +  endif
> +endif
>  if get_option('whpx').allowed() and targetos == 'windows'
>    if get_option('whpx').enabled() and host_machine.cpu() != 'x86_64'
>      error('WHPX requires 64-bit host')
> @@ -482,6 +494,9 @@ endif
>  if 'CONFIG_KVM' not in accelerators and get_option('kvm').enabled()
>    error('KVM not available on this platform')
>  endif
> +if 'CONFIG_AEHD' not in accelerators and get_option('aehd').enabled()
> +  error('AEHD not available on this platform')
> +endif
>  if 'CONFIG_HVF' not in accelerators and get_option('hvf').enabled()
>    error('HVF not available on this platform')
>  endif
> @@ -3873,6 +3888,7 @@ endif
>  summary_info = {}
>  if have_system
>    summary_info += {'KVM support':       config_all.has_key('CONFIG_KVM')}
> +  summary_info += {'AEHD support':      config_all.has_key('CONFIG_AEHD')}
>    summary_info += {'HAX support':       config_all.has_key('CONFIG_HAX')}
>    summary_info += {'HVF support':       config_all.has_key('CONFIG_HVF')}
>    summary_info += {'WHPX support':      config_all.has_key('CONFIG_WHPX')}
> diff --git a/meson_options.txt b/meson_options.txt
> index fc9447d267..d3e9805b6d 100644
> --- a/meson_options.txt
> +++ b/meson_options.txt
> @@ -66,6 +66,8 @@ option('malloc', type : 'combo', choices : ['system', 'tcmalloc', 'jemalloc'],
>  
>  option('kvm', type: 'feature', value: 'auto',
>         description: 'KVM acceleration support')
> +option('aehd', type: 'feature', value: 'auto',
> +       description: 'AEHD acceleration support')
>  option('hax', type: 'feature', value: 'auto',
>         description: 'HAX acceleration support')
>  option('whpx', type: 'feature', value: 'auto',
> diff --git a/qemu-options.hx b/qemu-options.hx
> index beeb4475ba..2870c54a43 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, nvmm, whpx or tcg (default: tcg)\n"
> +    "                supported accelerators are kvm, xen, hax, hvf, nvmm, whpx, aehd 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"
> @@ -59,10 +59,10 @@ SRST
>  
>      ``accel=accels1[:accels2[:...]]``
>          This is used to enable an accelerator. Depending on the target
> -        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.
> +        architecture, kvm, xen, hax, hvf, nvmm, whpx, aehd 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.
>  
>      ``vmport=on|off|auto``
>          Enables emulation of VMWare IO port, for vmmouse etc. auto says
> @@ -178,7 +178,7 @@ ERST
>  
>  DEF("accel", HAS_ARG, QEMU_OPTION_accel,
>      "-accel [accel=]accelerator[,prop[=value][,...]]\n"
> -    "                select accelerator (kvm, xen, hax, hvf, nvmm, whpx or tcg; use 'help' for a list)\n"
> +    "                select accelerator (kvm, xen, hax, hvf, nvmm, whpx, aehd 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"
> @@ -190,10 +190,10 @@ 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, 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.
> +    architecture, kvm, xen, hax, hvf, nvmm, whpx, aehd 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.
>  
>      ``igd-passthru=on|off``
>          When Xen is in use, this option controls whether Intel
> diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
> index 009fab1515..f17df07c5d 100644
> --- a/scripts/meson-buildoptions.sh
> +++ b/scripts/meson-buildoptions.sh
> @@ -289,6 +289,8 @@ _meson_option_parse() {
>      --disable-guest-agent) printf "%s" -Dguest_agent=disabled ;;
>      --enable-guest-agent-msi) printf "%s" -Dguest_agent_msi=enabled ;;
>      --disable-guest-agent-msi) printf "%s" -Dguest_agent_msi=disabled ;;
> +    --enable-aehd) printf "%s" -Daehd=enabled ;;
> +    --disable-aehd) printf "%s" -Daehd=disabled ;;
>      --enable-hax) printf "%s" -Dhax=enabled ;;
>      --disable-hax) printf "%s" -Dhax=disabled ;;
>      --enable-hexagon-idef-parser) printf "%s" -Dhexagon_idef_parser=true ;;
> -- 
> 2.40.0.rc0.216.gc4246ad0f0-goog
> 
> 
>
Philippe Mathieu-Daudé March 3, 2023, 10:19 a.m. UTC | #2
On 3/3/23 08:33, Michael S. Tsirkin wrote:
> On Thu, Mar 02, 2023 at 06:26:12PM -0800, Haitao Shan wrote:
>> Add the configure support for the Android Emulator hypervisor driver
>> accelerator. The Android Emulator hypervisor driver is a Windows
>> driver made by porting the KVM from kernel 4.9-rc7.
>>
>> Signed-off-by: Haitao Shan <hshan@google.com>
> 
> Replying on patch 1 but it applies to the whole patchset.

Indeed this series lacks a cover letter, which would show
this huge diffstat:

  MAINTAINERS                       |   12 +
  accel/Kconfig                     |    3 +
  docs/about/build-platforms.rst    |    2 +-
  hw/i386/aehd/apic.c               |  204 +++++++++++++++
  hw/i386/aehd/i8259.c              |  165 ++++++++++++
  hw/i386/aehd/ioapic.c             |  164 ++++++++++++
  hw/i386/aehd/meson.build          |    6 +
  hw/i386/meson.build               |    1 +
  hw/i386/pc.c                      |    5 +
  hw/i386/x86.c                     |    5 +-
  include/exec/poison.h             |    1 +
  include/exec/ram_addr.h           |    2 -
  include/hw/core/cpu.h             |    7 +
  include/hw/intc/i8259.h           |    1 +
  include/hw/intc/ioapic.h          |    1 +
  include/sysemu/aehd-interface.h   |  878 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  include/sysemu/aehd.h             |  168 ++++++++++++
  include/sysemu/hw_accel.h         |    1 +
  meson.build                       |   16 ++
  meson_options.txt                 |    2 +
  qemu-options.hx                   |   20 +-
  scripts/meson-buildoptions.sh     |    2 +
  target/i386/aehd/aehd-accel-ops.c |  119 +++++++++
  target/i386/aehd/aehd-accel-ops.h |   22 ++
  target/i386/aehd/aehd-all.c       | 1349 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  target/i386/aehd/aehd-cpu.c       |  150 +++++++++++
  target/i386/aehd/aehd-cpu.h       |   41 +++
  target/i386/aehd/aehd-stub.c      |   22 ++
  target/i386/aehd/aehd.c           | 2003 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  target/i386/aehd/aehd_i386.h      |   26 ++
  target/i386/aehd/aehd_int.h       |   50 ++++
  target/i386/aehd/meson.build      |    8 +
  target/i386/cpu-sysemu.c          |    3 +
  target/i386/cpu.c                 |   12 +-
  target/i386/cpu.h                 |    5 +-
  target/i386/helper.c              |    3 +
  target/i386/meson.build           |    2 +
  37 files changed, 5465 insertions(+), 16 deletions(-)

> There's obvious duplication with kvm here - probably not surprising.
> 
> I'd be interested to hear from KVM people to know whether
> there's interest in unifying code, or they would rather
> not bother supporting this platform and it's better off
> being kept separate.

I believe the hw part can be unified, reducing the maintenance
cost. (I gave Haitao few hints replying to the relevant patches).

Regards,

Phil.
Philippe Mathieu-Daudé March 3, 2023, 10:25 a.m. UTC | #3
On 3/3/23 11:19, Philippe Mathieu-Daudé wrote:
> On 3/3/23 08:33, Michael S. Tsirkin wrote:
>> On Thu, Mar 02, 2023 at 06:26:12PM -0800, Haitao Shan wrote:
>>> Add the configure support for the Android Emulator hypervisor driver
>>> accelerator. The Android Emulator hypervisor driver is a Windows
>>> driver made by porting the KVM from kernel 4.9-rc7.
>>>
>>> Signed-off-by: Haitao Shan <hshan@google.com>
>>
>> Replying on patch 1 but it applies to the whole patchset.
> 
> Indeed this series lacks a cover letter, 
I just noticed the cover letter in my inbox, oddly delivered after
the patches:
https://lore.kernel.org/qemu-devel/CAGD3tSzW1QoAsn+uGjoAkBegLt1iZ=9YWDFcvqbcHMr0S_5kVw@mail.gmail.com/
(note the patches are disconnected from the cover, and the cover lacks
the diffstat).

> which would show
> this huge diffstat:
> 
>   MAINTAINERS                       |   12 +
>   accel/Kconfig                     |    3 +
>   docs/about/build-platforms.rst    |    2 +-
>   hw/i386/aehd/apic.c               |  204 +++++++++++++++
>   hw/i386/aehd/i8259.c              |  165 ++++++++++++
>   hw/i386/aehd/ioapic.c             |  164 ++++++++++++
>   hw/i386/aehd/meson.build          |    6 +
>   hw/i386/meson.build               |    1 +
>   hw/i386/pc.c                      |    5 +
>   hw/i386/x86.c                     |    5 +-
>   include/exec/poison.h             |    1 +
>   include/exec/ram_addr.h           |    2 -
>   include/hw/core/cpu.h             |    7 +
>   include/hw/intc/i8259.h           |    1 +
>   include/hw/intc/ioapic.h          |    1 +
>   include/sysemu/aehd-interface.h   |  878 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>   include/sysemu/aehd.h             |  168 ++++++++++++
>   include/sysemu/hw_accel.h         |    1 +
>   meson.build                       |   16 ++
>   meson_options.txt                 |    2 +
>   qemu-options.hx                   |   20 +-
>   scripts/meson-buildoptions.sh     |    2 +
>   target/i386/aehd/aehd-accel-ops.c |  119 +++++++++
>   target/i386/aehd/aehd-accel-ops.h |   22 ++
>   target/i386/aehd/aehd-all.c       | 1349 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>   target/i386/aehd/aehd-cpu.c       |  150 +++++++++++
>   target/i386/aehd/aehd-cpu.h       |   41 +++
>   target/i386/aehd/aehd-stub.c      |   22 ++
>   target/i386/aehd/aehd.c           | 2003 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>   target/i386/aehd/aehd_i386.h      |   26 ++
>   target/i386/aehd/aehd_int.h       |   50 ++++
>   target/i386/aehd/meson.build      |    8 +
>   target/i386/cpu-sysemu.c          |    3 +
>   target/i386/cpu.c                 |   12 +-
>   target/i386/cpu.h                 |    5 +-
>   target/i386/helper.c              |    3 +
>   target/i386/meson.build           |    2 +
>   37 files changed, 5465 insertions(+), 16 deletions(-)
> 
>> There's obvious duplication with kvm here - probably not surprising.
>>
>> I'd be interested to hear from KVM people to know whether
>> there's interest in unifying code, or they would rather
>> not bother supporting this platform and it's better off
>> being kept separate.
> 
> I believe the hw part can be unified, reducing the maintenance
> cost. (I gave Haitao few hints replying to the relevant patches).
> 
> Regards,
> 
> Phil.
Haitao Shan March 3, 2023, 5:20 p.m. UTC | #4
On Thu, Mar 2, 2023 at 11:33 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Thu, Mar 02, 2023 at 06:26:12PM -0800, Haitao Shan wrote:
> > Add the configure support for the Android Emulator hypervisor driver
> > accelerator. The Android Emulator hypervisor driver is a Windows
> > driver made by porting the KVM from kernel 4.9-rc7.
> >
> > Signed-off-by: Haitao Shan <hshan@google.com>
>
> Replying on patch 1 but it applies to the whole patchset.
>
> There's obvious duplication with kvm here - probably not surprising.
>
> I'd be interested to hear from KVM people to know whether
> there's interest in unifying code, or they would rather
> not bother supporting this platform and it's better off
> being kept separate.
Thanks for the reply.

When I first started working on the new
hypervisor (I am also the author of the hypervisor itself), I
tried to make it "unified" with the KVM. But I soon gave up.
One of the reasons is type "long or unsigned long". It is used
everywhere by the KVM (or perhaps the kernel itself) to
represent memory addresses. But the Microsoft compiler
does not think "long == 64bit integer" targeting 64bit Windows.
I could not think of a way to change it beautifully and make
AEHD ready for periodically rebasing to the latest KVM.

Since being fully compatible with KVM was not a goal
any more, I also gave up support of some of KVM legacies.
For example, those related to enlightened guests be it
KVM or HyperV enlightenment. The userspace can
assume certain capabilities without checking, for example,
in kernel irqchip.

Currently, the decision for the AEHD is to clone once
and go seperated with KVM.

With that said, it was still possible to share codes in
the user space code with KVM. But I was afraid
whether the qemu KVM part could see this as a burden
if I tried to hack the KVM user space to support AEHD.
Anyway, KVM keeps revolving. There might be more
and more conditioned code branches simply to make
AEHD happy, should the user space code be "unified".

>
> > ---
> >  accel/Kconfig                  |  3 +++
> >  docs/about/build-platforms.rst |  2 +-
> >  include/exec/poison.h          |  1 +
> >  meson.build                    | 16 ++++++++++++++++
> >  meson_options.txt              |  2 ++
> >  qemu-options.hx                | 20 ++++++++++----------
> >  scripts/meson-buildoptions.sh  |  2 ++
> >  7 files changed, 35 insertions(+), 11 deletions(-)
> >
> > diff --git a/accel/Kconfig b/accel/Kconfig
> > index 8bdedb7d15..187d8f6acf 100644
> > --- a/accel/Kconfig
> > +++ b/accel/Kconfig
> > @@ -16,6 +16,9 @@ config TCG
> >  config KVM
> >      bool
> >
> > +config AEHD
> > +    bool
> > +
> >  config XEN
> >      bool
> >      select FSDEV_9P if VIRTFS
> > diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
> > index 20b97c3310..184707bd62 100644
> > --- a/docs/about/build-platforms.rst
> > +++ b/docs/about/build-platforms.rst
> > @@ -52,7 +52,7 @@ Those hosts are officially supported, with various accelerators:
> >     * - SPARC
> >       - tcg
> >     * - x86
> > -     - hax, hvf (64 bit only), kvm, nvmm, tcg, whpx (64 bit only), xen
> > +     - aehd (64 bit only), hax, hvf (64 bit only), kvm, nvmm, tcg, whpx (64 bit only), xen
> >
> >  Other host architectures are not supported. It is possible to build QEMU system
> >  emulation on an unsupported host architecture using the configure
> > diff --git a/include/exec/poison.h b/include/exec/poison.h
> > index 140daa4a85..cb851744d1 100644
> > --- a/include/exec/poison.h
> > +++ b/include/exec/poison.h
> > @@ -86,6 +86,7 @@
> >  #pragma GCC poison CONFIG_HVF
> >  #pragma GCC poison CONFIG_LINUX_USER
> >  #pragma GCC poison CONFIG_KVM
> > +#pragma GCC poison CONFIG_AEHD
> >  #pragma GCC poison CONFIG_SOFTMMU
> >  #pragma GCC poison CONFIG_WHPX
> >  #pragma GCC poison CONFIG_XEN
> > diff --git a/meson.build b/meson.build
> > index 77d2ae87e4..f2b049ceac 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -146,6 +146,11 @@ if cpu in ['x86', 'x86_64']
> >      'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
> >    }
> >  endif
> > +if cpu in ['x86_64']
> > +  accelerator_targets += {
> > +    'CONFIG_AEHD': ['i386-softmmu', 'x86_64-softmmu'],
> > +  }
> > +endif
> >
> >  modular_tcg = []
> >  # Darwin does not support references to thread-local variables in modules
> > @@ -421,6 +426,13 @@ accelerators = []
> >  if get_option('kvm').allowed() and targetos == 'linux'
> >    accelerators += 'CONFIG_KVM'
> >  endif
> > +if get_option('aehd').allowed() and targetos == 'windows'
> > +  if get_option('aehd').enabled() and host_machine.cpu() != 'x86_64'
> > +    error('AEHD requires 64-bit host')
> > +  else
> > +    accelerators += 'CONFIG_AEHD'
> > +  endif
> > +endif
> >  if get_option('whpx').allowed() and targetos == 'windows'
> >    if get_option('whpx').enabled() and host_machine.cpu() != 'x86_64'
> >      error('WHPX requires 64-bit host')
> > @@ -482,6 +494,9 @@ endif
> >  if 'CONFIG_KVM' not in accelerators and get_option('kvm').enabled()
> >    error('KVM not available on this platform')
> >  endif
> > +if 'CONFIG_AEHD' not in accelerators and get_option('aehd').enabled()
> > +  error('AEHD not available on this platform')
> > +endif
> >  if 'CONFIG_HVF' not in accelerators and get_option('hvf').enabled()
> >    error('HVF not available on this platform')
> >  endif
> > @@ -3873,6 +3888,7 @@ endif
> >  summary_info = {}
> >  if have_system
> >    summary_info += {'KVM support':       config_all.has_key('CONFIG_KVM')}
> > +  summary_info += {'AEHD support':      config_all.has_key('CONFIG_AEHD')}
> >    summary_info += {'HAX support':       config_all.has_key('CONFIG_HAX')}
> >    summary_info += {'HVF support':       config_all.has_key('CONFIG_HVF')}
> >    summary_info += {'WHPX support':      config_all.has_key('CONFIG_WHPX')}
> > diff --git a/meson_options.txt b/meson_options.txt
> > index fc9447d267..d3e9805b6d 100644
> > --- a/meson_options.txt
> > +++ b/meson_options.txt
> > @@ -66,6 +66,8 @@ option('malloc', type : 'combo', choices : ['system', 'tcmalloc', 'jemalloc'],
> >
> >  option('kvm', type: 'feature', value: 'auto',
> >         description: 'KVM acceleration support')
> > +option('aehd', type: 'feature', value: 'auto',
> > +       description: 'AEHD acceleration support')
> >  option('hax', type: 'feature', value: 'auto',
> >         description: 'HAX acceleration support')
> >  option('whpx', type: 'feature', value: 'auto',
> > diff --git a/qemu-options.hx b/qemu-options.hx
> > index beeb4475ba..2870c54a43 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, nvmm, whpx or tcg (default: tcg)\n"
> > +    "                supported accelerators are kvm, xen, hax, hvf, nvmm, whpx, aehd 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"
> > @@ -59,10 +59,10 @@ SRST
> >
> >      ``accel=accels1[:accels2[:...]]``
> >          This is used to enable an accelerator. Depending on the target
> > -        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.
> > +        architecture, kvm, xen, hax, hvf, nvmm, whpx, aehd 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.
> >
> >      ``vmport=on|off|auto``
> >          Enables emulation of VMWare IO port, for vmmouse etc. auto says
> > @@ -178,7 +178,7 @@ ERST
> >
> >  DEF("accel", HAS_ARG, QEMU_OPTION_accel,
> >      "-accel [accel=]accelerator[,prop[=value][,...]]\n"
> > -    "                select accelerator (kvm, xen, hax, hvf, nvmm, whpx or tcg; use 'help' for a list)\n"
> > +    "                select accelerator (kvm, xen, hax, hvf, nvmm, whpx, aehd 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"
> > @@ -190,10 +190,10 @@ 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, 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.
> > +    architecture, kvm, xen, hax, hvf, nvmm, whpx, aehd 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.
> >
> >      ``igd-passthru=on|off``
> >          When Xen is in use, this option controls whether Intel
> > diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
> > index 009fab1515..f17df07c5d 100644
> > --- a/scripts/meson-buildoptions.sh
> > +++ b/scripts/meson-buildoptions.sh
> > @@ -289,6 +289,8 @@ _meson_option_parse() {
> >      --disable-guest-agent) printf "%s" -Dguest_agent=disabled ;;
> >      --enable-guest-agent-msi) printf "%s" -Dguest_agent_msi=enabled ;;
> >      --disable-guest-agent-msi) printf "%s" -Dguest_agent_msi=disabled ;;
> > +    --enable-aehd) printf "%s" -Daehd=enabled ;;
> > +    --disable-aehd) printf "%s" -Daehd=disabled ;;
> >      --enable-hax) printf "%s" -Dhax=enabled ;;
> >      --disable-hax) printf "%s" -Dhax=disabled ;;
> >      --enable-hexagon-idef-parser) printf "%s" -Dhexagon_idef_parser=true ;;
> > --
> > 2.40.0.rc0.216.gc4246ad0f0-goog
> >
> >
> >
>
Haitao Shan March 3, 2023, 5:24 p.m. UTC | #5
On Fri, Mar 3, 2023 at 2:19 AM Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> On 3/3/23 08:33, Michael S. Tsirkin wrote:
> > On Thu, Mar 02, 2023 at 06:26:12PM -0800, Haitao Shan wrote:
> >> Add the configure support for the Android Emulator hypervisor driver
> >> accelerator. The Android Emulator hypervisor driver is a Windows
> >> driver made by porting the KVM from kernel 4.9-rc7.
> >>
> >> Signed-off-by: Haitao Shan <hshan@google.com>
> >
> > Replying on patch 1 but it applies to the whole patchset.
>
> Indeed this series lacks a cover letter, which would show
> this huge diffstat:
Sorry. I think I made a mistake and I know being new to
the community is not an excuse. I will correct it in future.
I don't know if "git sendmail" can have a cover letter. So the
cover letter was written separately. Again, I am sorry for
that.
>
>   MAINTAINERS                       |   12 +
>   accel/Kconfig                     |    3 +
>   docs/about/build-platforms.rst    |    2 +-
>   hw/i386/aehd/apic.c               |  204 +++++++++++++++
>   hw/i386/aehd/i8259.c              |  165 ++++++++++++
>   hw/i386/aehd/ioapic.c             |  164 ++++++++++++
>   hw/i386/aehd/meson.build          |    6 +
>   hw/i386/meson.build               |    1 +
>   hw/i386/pc.c                      |    5 +
>   hw/i386/x86.c                     |    5 +-
>   include/exec/poison.h             |    1 +
>   include/exec/ram_addr.h           |    2 -
>   include/hw/core/cpu.h             |    7 +
>   include/hw/intc/i8259.h           |    1 +
>   include/hw/intc/ioapic.h          |    1 +
>   include/sysemu/aehd-interface.h   |  878
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>   include/sysemu/aehd.h             |  168 ++++++++++++
>   include/sysemu/hw_accel.h         |    1 +
>   meson.build                       |   16 ++
>   meson_options.txt                 |    2 +
>   qemu-options.hx                   |   20 +-
>   scripts/meson-buildoptions.sh     |    2 +
>   target/i386/aehd/aehd-accel-ops.c |  119 +++++++++
>   target/i386/aehd/aehd-accel-ops.h |   22 ++
>   target/i386/aehd/aehd-all.c       | 1349
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>   target/i386/aehd/aehd-cpu.c       |  150 +++++++++++
>   target/i386/aehd/aehd-cpu.h       |   41 +++
>   target/i386/aehd/aehd-stub.c      |   22 ++
>   target/i386/aehd/aehd.c           | 2003
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>   target/i386/aehd/aehd_i386.h      |   26 ++
>   target/i386/aehd/aehd_int.h       |   50 ++++
>   target/i386/aehd/meson.build      |    8 +
>   target/i386/cpu-sysemu.c          |    3 +
>   target/i386/cpu.c                 |   12 +-
>   target/i386/cpu.h                 |    5 +-
>   target/i386/helper.c              |    3 +
>   target/i386/meson.build           |    2 +
>   37 files changed, 5465 insertions(+), 16 deletions(-)
>
> > There's obvious duplication with kvm here - probably not surprising.
> >
> > I'd be interested to hear from KVM people to know whether
> > there's interest in unifying code, or they would rather
> > not bother supporting this platform and it's better off
> > being kept separate.
>
> I believe the hw part can be unified, reducing the maintenance
> cost. (I gave Haitao few hints replying to the relevant patches).
Thanks. I will follow up in the relevant patch thread.
>
> Regards,
>
> Phil.
Haitao Shan March 3, 2023, 5:25 p.m. UTC | #6
On Fri, Mar 3, 2023 at 2:25 AM Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> On 3/3/23 11:19, Philippe Mathieu-Daudé wrote:
> > On 3/3/23 08:33, Michael S. Tsirkin wrote:
> >> On Thu, Mar 02, 2023 at 06:26:12PM -0800, Haitao Shan wrote:
> >>> Add the configure support for the Android Emulator hypervisor driver
> >>> accelerator. The Android Emulator hypervisor driver is a Windows
> >>> driver made by porting the KVM from kernel 4.9-rc7.
> >>>
> >>> Signed-off-by: Haitao Shan <hshan@google.com>
> >>
> >> Replying on patch 1 but it applies to the whole patchset.
> >
> > Indeed this series lacks a cover letter,
> I just noticed the cover letter in my inbox, oddly delivered after
> the patches:
> https://lore.kernel.org/qemu-devel/CAGD3tSzW1QoAsn+uGjoAkBegLt1iZ=9YWDFcvqbcHMr0S_5kVw@mail.gmail.com/
> (note the patches are disconnected from the cover, and the cover lacks
> the diffstat).
Again, I am sorry for the trouble. I will figure out how to
send cover letter properly together with other patches
using "git sendmail".
>
> > which would show
> > this huge diffstat:
> >
> >   MAINTAINERS                       |   12 +
> >   accel/Kconfig                     |    3 +
> >   docs/about/build-platforms.rst    |    2 +-
> >   hw/i386/aehd/apic.c               |  204 +++++++++++++++
> >   hw/i386/aehd/i8259.c              |  165 ++++++++++++
> >   hw/i386/aehd/ioapic.c             |  164 ++++++++++++
> >   hw/i386/aehd/meson.build          |    6 +
> >   hw/i386/meson.build               |    1 +
> >   hw/i386/pc.c                      |    5 +
> >   hw/i386/x86.c                     |    5 +-
> >   include/exec/poison.h             |    1 +
> >   include/exec/ram_addr.h           |    2 -
> >   include/hw/core/cpu.h             |    7 +
> >   include/hw/intc/i8259.h           |    1 +
> >   include/hw/intc/ioapic.h          |    1 +
> >   include/sysemu/aehd-interface.h   |  878
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >   include/sysemu/aehd.h             |  168 ++++++++++++
> >   include/sysemu/hw_accel.h         |    1 +
> >   meson.build                       |   16 ++
> >   meson_options.txt                 |    2 +
> >   qemu-options.hx                   |   20 +-
> >   scripts/meson-buildoptions.sh     |    2 +
> >   target/i386/aehd/aehd-accel-ops.c |  119 +++++++++
> >   target/i386/aehd/aehd-accel-ops.h |   22 ++
> >   target/i386/aehd/aehd-all.c       | 1349
> > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >   target/i386/aehd/aehd-cpu.c       |  150 +++++++++++
> >   target/i386/aehd/aehd-cpu.h       |   41 +++
> >   target/i386/aehd/aehd-stub.c      |   22 ++
> >   target/i386/aehd/aehd.c           | 2003
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >   target/i386/aehd/aehd_i386.h      |   26 ++
> >   target/i386/aehd/aehd_int.h       |   50 ++++
> >   target/i386/aehd/meson.build      |    8 +
> >   target/i386/cpu-sysemu.c          |    3 +
> >   target/i386/cpu.c                 |   12 +-
> >   target/i386/cpu.h                 |    5 +-
> >   target/i386/helper.c              |    3 +
> >   target/i386/meson.build           |    2 +
> >   37 files changed, 5465 insertions(+), 16 deletions(-)
> >
> >> There's obvious duplication with kvm here - probably not surprising.
> >>
> >> I'd be interested to hear from KVM people to know whether
> >> there's interest in unifying code, or they would rather
> >> not bother supporting this platform and it's better off
> >> being kept separate.
> >
> > I believe the hw part can be unified, reducing the maintenance
> > cost. (I gave Haitao few hints replying to the relevant patches).
> >
> > Regards,
> >
> > Phil.
>
Daniel P. Berrangé March 3, 2023, 5:29 p.m. UTC | #7
On Fri, Mar 03, 2023 at 09:24:16AM -0800, Haitao Shan wrote:
> On Fri, Mar 3, 2023 at 2:19 AM Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> >
> > On 3/3/23 08:33, Michael S. Tsirkin wrote:
> > > On Thu, Mar 02, 2023 at 06:26:12PM -0800, Haitao Shan wrote:
> > >> Add the configure support for the Android Emulator hypervisor driver
> > >> accelerator. The Android Emulator hypervisor driver is a Windows
> > >> driver made by porting the KVM from kernel 4.9-rc7.
> > >>
> > >> Signed-off-by: Haitao Shan <hshan@google.com>
> > >
> > > Replying on patch 1 but it applies to the whole patchset.
> >
> > Indeed this series lacks a cover letter, which would show
> > this huge diffstat:
> Sorry. I think I made a mistake and I know being new to
> the community is not an excuse. I will correct it in future.
> I don't know if "git sendmail" can have a cover letter. So the
> cover letter was written separately. Again, I am sorry for
> that.

FWIW, I can recommend using the 'git-publish'[1] tool instead
of git sendemail.  git-publish helps to just "do the right
thing" without you needing to know the details. It will prompt
for a cover letter to be entered, include the diffstat, and
CC any maintainers related to files your patch touches. It
figures this all our from the .gitpublish file that is in the
root of the QEMU git repo.

If you want test send some mails, then just tell git-publsh to
send to yourself instead of qemu-devel.

With regards,
Daniel

[1] https://github.com/stefanha/git-publish
Haitao Shan March 3, 2023, 5:41 p.m. UTC | #8
On Fri, Mar 3, 2023 at 9:29 AM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Fri, Mar 03, 2023 at 09:24:16AM -0800, Haitao Shan wrote:
> > On Fri, Mar 3, 2023 at 2:19 AM Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> > >
> > > On 3/3/23 08:33, Michael S. Tsirkin wrote:
> > > > On Thu, Mar 02, 2023 at 06:26:12PM -0800, Haitao Shan wrote:
> > > >> Add the configure support for the Android Emulator hypervisor driver
> > > >> accelerator. The Android Emulator hypervisor driver is a Windows
> > > >> driver made by porting the KVM from kernel 4.9-rc7.
> > > >>
> > > >> Signed-off-by: Haitao Shan <hshan@google.com>
> > > >
> > > > Replying on patch 1 but it applies to the whole patchset.
> > >
> > > Indeed this series lacks a cover letter, which would show
> > > this huge diffstat:
> > Sorry. I think I made a mistake and I know being new to
> > the community is not an excuse. I will correct it in future.
> > I don't know if "git sendmail" can have a cover letter. So the
> > cover letter was written separately. Again, I am sorry for
> > that.
>
> FWIW, I can recommend using the 'git-publish'[1] tool instead
> of git sendemail.  git-publish helps to just "do the right
> thing" without you needing to know the details. It will prompt
> for a cover letter to be entered, include the diffstat, and
> CC any maintainers related to files your patch touches. It
> figures this all our from the .gitpublish file that is in the
> root of the QEMU git repo.
>
> If you want test send some mails, then just tell git-publsh to
> send to yourself instead of qemu-devel.
Got it. Thank you very much for your advice. I am going to do
the experiment now.

>
> With regards,
> Daniel
>
> [1] https://github.com/stefanha/git-publish
> --
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
>
diff mbox series

Patch

diff --git a/accel/Kconfig b/accel/Kconfig
index 8bdedb7d15..187d8f6acf 100644
--- a/accel/Kconfig
+++ b/accel/Kconfig
@@ -16,6 +16,9 @@  config TCG
 config KVM
     bool
 
+config AEHD
+    bool
+
 config XEN
     bool
     select FSDEV_9P if VIRTFS
diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst
index 20b97c3310..184707bd62 100644
--- a/docs/about/build-platforms.rst
+++ b/docs/about/build-platforms.rst
@@ -52,7 +52,7 @@  Those hosts are officially supported, with various accelerators:
    * - SPARC
      - tcg
    * - x86
-     - hax, hvf (64 bit only), kvm, nvmm, tcg, whpx (64 bit only), xen
+     - aehd (64 bit only), hax, hvf (64 bit only), kvm, nvmm, tcg, whpx (64 bit only), xen
 
 Other host architectures are not supported. It is possible to build QEMU system
 emulation on an unsupported host architecture using the configure
diff --git a/include/exec/poison.h b/include/exec/poison.h
index 140daa4a85..cb851744d1 100644
--- a/include/exec/poison.h
+++ b/include/exec/poison.h
@@ -86,6 +86,7 @@ 
 #pragma GCC poison CONFIG_HVF
 #pragma GCC poison CONFIG_LINUX_USER
 #pragma GCC poison CONFIG_KVM
+#pragma GCC poison CONFIG_AEHD
 #pragma GCC poison CONFIG_SOFTMMU
 #pragma GCC poison CONFIG_WHPX
 #pragma GCC poison CONFIG_XEN
diff --git a/meson.build b/meson.build
index 77d2ae87e4..f2b049ceac 100644
--- a/meson.build
+++ b/meson.build
@@ -146,6 +146,11 @@  if cpu in ['x86', 'x86_64']
     'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
   }
 endif
+if cpu in ['x86_64']
+  accelerator_targets += {
+    'CONFIG_AEHD': ['i386-softmmu', 'x86_64-softmmu'],
+  }
+endif
 
 modular_tcg = []
 # Darwin does not support references to thread-local variables in modules
@@ -421,6 +426,13 @@  accelerators = []
 if get_option('kvm').allowed() and targetos == 'linux'
   accelerators += 'CONFIG_KVM'
 endif
+if get_option('aehd').allowed() and targetos == 'windows'
+  if get_option('aehd').enabled() and host_machine.cpu() != 'x86_64'
+    error('AEHD requires 64-bit host')
+  else
+    accelerators += 'CONFIG_AEHD'
+  endif
+endif
 if get_option('whpx').allowed() and targetos == 'windows'
   if get_option('whpx').enabled() and host_machine.cpu() != 'x86_64'
     error('WHPX requires 64-bit host')
@@ -482,6 +494,9 @@  endif
 if 'CONFIG_KVM' not in accelerators and get_option('kvm').enabled()
   error('KVM not available on this platform')
 endif
+if 'CONFIG_AEHD' not in accelerators and get_option('aehd').enabled()
+  error('AEHD not available on this platform')
+endif
 if 'CONFIG_HVF' not in accelerators and get_option('hvf').enabled()
   error('HVF not available on this platform')
 endif
@@ -3873,6 +3888,7 @@  endif
 summary_info = {}
 if have_system
   summary_info += {'KVM support':       config_all.has_key('CONFIG_KVM')}
+  summary_info += {'AEHD support':      config_all.has_key('CONFIG_AEHD')}
   summary_info += {'HAX support':       config_all.has_key('CONFIG_HAX')}
   summary_info += {'HVF support':       config_all.has_key('CONFIG_HVF')}
   summary_info += {'WHPX support':      config_all.has_key('CONFIG_WHPX')}
diff --git a/meson_options.txt b/meson_options.txt
index fc9447d267..d3e9805b6d 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -66,6 +66,8 @@  option('malloc', type : 'combo', choices : ['system', 'tcmalloc', 'jemalloc'],
 
 option('kvm', type: 'feature', value: 'auto',
        description: 'KVM acceleration support')
+option('aehd', type: 'feature', value: 'auto',
+       description: 'AEHD acceleration support')
 option('hax', type: 'feature', value: 'auto',
        description: 'HAX acceleration support')
 option('whpx', type: 'feature', value: 'auto',
diff --git a/qemu-options.hx b/qemu-options.hx
index beeb4475ba..2870c54a43 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, nvmm, whpx or tcg (default: tcg)\n"
+    "                supported accelerators are kvm, xen, hax, hvf, nvmm, whpx, aehd 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"
@@ -59,10 +59,10 @@  SRST
 
     ``accel=accels1[:accels2[:...]]``
         This is used to enable an accelerator. Depending on the target
-        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.
+        architecture, kvm, xen, hax, hvf, nvmm, whpx, aehd 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.
 
     ``vmport=on|off|auto``
         Enables emulation of VMWare IO port, for vmmouse etc. auto says
@@ -178,7 +178,7 @@  ERST
 
 DEF("accel", HAS_ARG, QEMU_OPTION_accel,
     "-accel [accel=]accelerator[,prop[=value][,...]]\n"
-    "                select accelerator (kvm, xen, hax, hvf, nvmm, whpx or tcg; use 'help' for a list)\n"
+    "                select accelerator (kvm, xen, hax, hvf, nvmm, whpx, aehd 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"
@@ -190,10 +190,10 @@  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, 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.
+    architecture, kvm, xen, hax, hvf, nvmm, whpx, aehd 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.
 
     ``igd-passthru=on|off``
         When Xen is in use, this option controls whether Intel
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 009fab1515..f17df07c5d 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -289,6 +289,8 @@  _meson_option_parse() {
     --disable-guest-agent) printf "%s" -Dguest_agent=disabled ;;
     --enable-guest-agent-msi) printf "%s" -Dguest_agent_msi=enabled ;;
     --disable-guest-agent-msi) printf "%s" -Dguest_agent_msi=disabled ;;
+    --enable-aehd) printf "%s" -Daehd=enabled ;;
+    --disable-aehd) printf "%s" -Daehd=disabled ;;
     --enable-hax) printf "%s" -Dhax=enabled ;;
     --disable-hax) printf "%s" -Dhax=disabled ;;
     --enable-hexagon-idef-parser) printf "%s" -Dhexagon_idef_parser=true ;;