[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/6] Add the Android Emulator hypervisor driver (AEHD) accele
From: |
Michael S. Tsirkin |
Subject: |
Re: [PATCH 1/6] Add the Android Emulator hypervisor driver (AEHD) accelerator. |
Date: |
Fri, 3 Mar 2023 02:33:34 -0500 |
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
>
>
>
- Re: [PATCH 3/6] Add the aehd-apic device type., (continued)
Re: [PATCH 1/6] Add the Android Emulator hypervisor driver (AEHD) accelerator., Haitao Shan, 2023/03/03