From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Magnus Kulke" <magnuskulke@linux.microsoft.com>,
"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PULL 07/35] accel: Add Meson and config support for MSHV accelerator
Date: Thu, 9 Oct 2025 09:49:57 +0200 [thread overview]
Message-ID: <20251009075026.505715-8-pbonzini@redhat.com> (raw)
In-Reply-To: <20251009075026.505715-1-pbonzini@redhat.com>
From: Magnus Kulke <magnuskulke@linux.microsoft.com>
Introduce a Meson feature option and default-config entry to allow
building QEMU with MSHV (Microsoft Hypervisor) acceleration support.
This is the first step toward implementing an MSHV backend in QEMU.
Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Link: https://lore.kernel.org/r/20250916164847.77883-2-magnuskulke@linux.microsoft.com
[Add error for unavailable accelerator. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 13 +++++++++++++
accel/Kconfig | 3 +++
meson_options.txt | 2 ++
scripts/meson-buildoptions.sh | 3 +++
4 files changed, 21 insertions(+)
diff --git a/meson.build b/meson.build
index 62766c0f19c..167021ed621 100644
--- a/meson.build
+++ b/meson.build
@@ -334,6 +334,7 @@ elif cpu == 'x86_64'
'CONFIG_HVF': ['x86_64-softmmu'],
'CONFIG_NVMM': ['i386-softmmu', 'x86_64-softmmu'],
'CONFIG_WHPX': ['i386-softmmu', 'x86_64-softmmu'],
+ 'CONFIG_MSHV': ['x86_64-softmmu'],
}
endif
@@ -883,6 +884,14 @@ accelerators = []
if get_option('kvm').allowed() and host_os == 'linux'
accelerators += 'CONFIG_KVM'
endif
+
+if get_option('mshv').allowed() and host_os == 'linux'
+ if get_option('mshv').enabled() and host_machine.cpu() != 'x86_64'
+ error('mshv accelerator requires x64_64 host')
+ endif
+ accelerators += 'CONFIG_MSHV'
+endif
+
if get_option('whpx').allowed() and host_os == 'windows'
if get_option('whpx').enabled() and host_machine.cpu() != 'x86_64'
error('WHPX requires 64-bit host')
@@ -952,6 +961,9 @@ endif
if 'CONFIG_WHPX' not in accelerators and get_option('whpx').enabled()
error('WHPX not available on this platform')
endif
+if 'CONFIG_MSHV' not in accelerators and get_option('mshv').enabled()
+ error('mshv not available on this platform')
+endif
xen = not_found
if get_option('xen').enabled() or (get_option('xen').auto() and have_system)
@@ -4827,6 +4839,7 @@ if have_system
summary_info += {'HVF support': config_all_accel.has_key('CONFIG_HVF')}
summary_info += {'WHPX support': config_all_accel.has_key('CONFIG_WHPX')}
summary_info += {'NVMM support': config_all_accel.has_key('CONFIG_NVMM')}
+ summary_info += {'MSHV support': config_all_accel.has_key('CONFIG_MSHV')}
summary_info += {'Xen support': xen.found()}
if xen.found()
summary_info += {'xen ctrl version': xen.version()}
diff --git a/accel/Kconfig b/accel/Kconfig
index 4263cab7227..a60f1149238 100644
--- a/accel/Kconfig
+++ b/accel/Kconfig
@@ -13,6 +13,9 @@ config TCG
config KVM
bool
+config MSHV
+ bool
+
config XEN
bool
select FSDEV_9P if VIRTFS
diff --git a/meson_options.txt b/meson_options.txt
index fff1521e580..1be7d61efdd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -71,6 +71,8 @@ option('malloc', type : 'combo', choices : ['system', 'tcmalloc', 'jemalloc'],
option('kvm', type: 'feature', value: 'auto',
description: 'KVM acceleration support')
+option('mshv', type: 'feature', value: 'auto',
+ description: 'MSHV acceleration support')
option('whpx', type: 'feature', value: 'auto',
description: 'WHPX acceleration support')
option('hvf', type: 'feature', value: 'auto',
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index 0ebe6bc52a6..d3d8f48bbbe 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -154,6 +154,7 @@ meson_options_help() {
printf "%s\n" ' membarrier membarrier system call (for Linux 4.14+ or Windows'
printf "%s\n" ' modules modules support (non Windows)'
printf "%s\n" ' mpath Multipath persistent reservation passthrough'
+ printf "%s\n" ' mshv MSHV acceleration support'
printf "%s\n" ' multiprocess Out of process device emulation support'
printf "%s\n" ' netmap netmap network backend support'
printf "%s\n" ' nettle nettle cryptography support'
@@ -408,6 +409,8 @@ _meson_option_parse() {
--disable-modules) printf "%s" -Dmodules=disabled ;;
--enable-mpath) printf "%s" -Dmpath=enabled ;;
--disable-mpath) printf "%s" -Dmpath=disabled ;;
+ --enable-mshv) printf "%s" -Dmshv=enabled ;;
+ --disable-mshv) printf "%s" -Dmshv=disabled ;;
--enable-multiprocess) printf "%s" -Dmultiprocess=enabled ;;
--disable-multiprocess) printf "%s" -Dmultiprocess=disabled ;;
--enable-netmap) printf "%s" -Dnetmap=enabled ;;
--
2.51.0
next prev parent reply other threads:[~2025-10-09 7:55 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 7:49 [PULL 00/35] i386 (MSHV, migration) and Rust changes for 2025-10-09 Paolo Bonzini
2025-10-09 7:49 ` [PULL 01/35] subprojects: Remove version number from .gitignore Paolo Bonzini
2025-10-09 7:49 ` [PULL 02/35] subprojects: add glib-sys-rs Paolo Bonzini
2025-10-09 7:49 ` [PULL 03/35] rust: use glib-sys Paolo Bonzini
2025-10-09 7:49 ` [PULL 04/35] build-sys: default to host vendor for rust target triple Paolo Bonzini
2025-10-09 7:49 ` [PULL 05/35] target/i386: add compatibility property for arch_capabilities Paolo Bonzini
2025-10-09 7:49 ` [PULL 06/35] target/i386: add compatibility property for pdcm feature Paolo Bonzini
2025-10-09 7:49 ` Paolo Bonzini [this message]
2025-10-09 7:49 ` [PULL 08/35] target/i386/emulate: Allow instruction decoding from stream Paolo Bonzini
2025-10-09 7:49 ` [PULL 09/35] target/i386/mshv: Add x86 decoder/emu implementation Paolo Bonzini
2025-10-09 7:50 ` [PULL 10/35] hw/intc: Generalize APIC helper names from kvm_* to accel_* Paolo Bonzini
2025-11-03 21:43 ` Cédric Le Goater
2025-11-05 15:24 ` Magnus Kulke
2025-11-06 10:51 ` Cédric Le Goater
2025-10-09 7:50 ` [PULL 11/35] include/hw/hyperv: Add MSHV ABI header definitions Paolo Bonzini
2025-10-09 7:50 ` [PULL 12/35] linux-headers/linux: Add mshv.h headers Paolo Bonzini
2025-10-09 7:50 ` [PULL 13/35] accel/mshv: Add accelerator skeleton Paolo Bonzini
2025-10-09 7:50 ` [PULL 14/35] accel/mshv: Register memory region listeners Paolo Bonzini
2025-10-09 7:50 ` [PULL 15/35] accel/mshv: Initialize VM partition Paolo Bonzini
2025-10-09 7:50 ` [PULL 16/35] accel/mshv: Add vCPU creation and execution loop Paolo Bonzini
2025-10-21 15:48 ` Peter Maydell
2025-10-09 7:50 ` [PULL 17/35] accel/mshv: Add vCPU signal handling Paolo Bonzini
2025-10-09 7:50 ` [PULL 18/35] target/i386/mshv: Add CPU create and remove logic Paolo Bonzini
2025-10-09 7:50 ` [PULL 19/35] target/i386/mshv: Implement mshv_store_regs() Paolo Bonzini
2025-10-09 7:50 ` [PULL 20/35] target/i386/mshv: Implement mshv_get_standard_regs() Paolo Bonzini
2025-10-09 7:50 ` [PULL 21/35] target/i386/mshv: Implement mshv_get_special_regs() Paolo Bonzini
2025-10-09 7:50 ` [PULL 22/35] target/i386/mshv: Implement mshv_arch_put_registers() Paolo Bonzini
2025-10-09 7:50 ` [PULL 23/35] target/i386/mshv: Set local interrupt controller state Paolo Bonzini
2025-10-09 7:50 ` [PULL 24/35] target/i386/mshv: Register CPUID entries with MSHV Paolo Bonzini
2025-10-09 7:50 ` [PULL 25/35] target/i386/mshv: Register MSRs " Paolo Bonzini
2025-10-09 7:50 ` [PULL 26/35] target/i386/mshv: Integrate x86 instruction decoder/emulator Paolo Bonzini
2025-10-09 7:50 ` [PULL 27/35] target/i386/mshv: Write MSRs to the hypervisor Paolo Bonzini
2025-10-09 7:50 ` [PULL 28/35] target/i386/mshv: Implement mshv_vcpu_run() Paolo Bonzini
2025-10-21 15:27 ` Peter Maydell
2025-11-09 13:10 ` Bernhard Beschow
2025-11-25 11:25 ` Magnus Kulke
2025-10-09 7:50 ` [PULL 29/35] accel/mshv: Handle overlapping mem mappings Paolo Bonzini
2025-10-09 7:50 ` [PULL 30/35] qapi/accel: Allow to query mshv capabilities Paolo Bonzini
2025-10-09 7:50 ` [PULL 31/35] target/i386/mshv: Use preallocated page for hvcall Paolo Bonzini
2025-10-09 7:50 ` [PULL 32/35] docs: Add mshv to documentation Paolo Bonzini
2025-10-09 7:50 ` [PULL 33/35] MAINTAINERS: Add maintainers for mshv accelerator Paolo Bonzini
2025-10-09 7:50 ` [PULL 34/35] tests/docker: make --enable-rust overridable with EXTRA_CONFIGURE_OPTS Paolo Bonzini
2025-10-09 7:50 ` [PULL 35/35] rust: fix path to rust_root_crate.sh Paolo Bonzini
2025-10-09 16:23 ` [PULL 00/35] i386 (MSHV, migration) and Rust changes for 2025-10-09 Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251009075026.505715-8-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=berrange@redhat.com \
--cc=magnuskulke@linux.microsoft.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).