From nobody Mon Dec 15 18:19:49 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1754577749; cv=none; d=zohomail.com; s=zohoarc; b=L3mlYcLDuYnOHVWn6MHR8cqF6LebRgOAZagZVgrd46lBnbG24JiYHjoCLHby5JkY1dfDxLbP4bjktb7xt53rlsU6EMsWNgOVcHqQHCnfTsmW6YLCYHfbFObsjCRw2d9ZK62hZrMl2efsveIunOPK064KcZ+s7+bwTiHykvpF0qY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1754577749; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eiqHqTtQYb4hBWCdUXTzyoddRbEICBU93TfkiFGEmx8=; b=fpIWm/+P1tzGJkHvsP1e3WfkjPShQxxjSrl/81dGfVwQsAlgkgrOSKNU5pTTRBpvtq7SwnreesR8jFXgeVt9+O+xC3kqKmlYuSyGS9OT3Iw+o3iURX/TYN4GWMz4fHCaeKY2y0h/lyDOZ9rssasCAqR6MudURdxQqdBXODIYIe0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1754577749317690.9432221066456; Thu, 7 Aug 2025 07:42:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uk1nA-0006N6-Kv; Thu, 07 Aug 2025 10:40:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uk1n8-0006L7-RD for qemu-devel@nongnu.org; Thu, 07 Aug 2025 10:40:26 -0400 Received: from linux.microsoft.com ([13.77.154.182]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uk1n7-0000u0-45 for qemu-devel@nongnu.org; Thu, 07 Aug 2025 10:40:26 -0400 Received: from localhost.localdomain (unknown [167.220.208.72]) by linux.microsoft.com (Postfix) with ESMTPSA id 61720201BC67; Thu, 7 Aug 2025 07:40:19 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 61720201BC67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1754577623; bh=eiqHqTtQYb4hBWCdUXTzyoddRbEICBU93TfkiFGEmx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FqdcpL9cZOhTN8Oq78p8wvOKj6If2Ry9ti/b+byVGq/lSVMShbjcCaT86hP+7jPf/ o/YxcOpZVW9mY6KE3SC8rlelcioc6LIWZcZNbc5Z866CQGv/AKBg7ib3y583JAn5rq ZFs6vRERPRtNJ5WKDoMBHEIjo7rZfTeaTvknde60= From: Magnus Kulke To: qemu-devel@nongnu.org Cc: Eric Blake , Eduardo Habkost , "Michael S. Tsirkin" , Markus Armbruster , Magnus Kulke , Paolo Bonzini , Richard Henderson , Phil Dennis-Jordan , Marcel Apfelbaum , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Magnus Kulke , Cornelia Huck , Zhao Liu , Thomas Huth , Yanan Wang , Cameron Esfahani , Wei Liu , Wei Liu , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Roman Bolshakov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 01/26] accel: Add Meson and config support for MSHV accelerator Date: Thu, 7 Aug 2025 16:39:26 +0200 Message-Id: <20250807143951.1154713-2-magnuskulke@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250807143951.1154713-1-magnuskulke@linux.microsoft.com> References: <20250807143951.1154713-1-magnuskulke@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=13.77.154.182; envelope-from=magnuskulke@linux.microsoft.com; helo=linux.microsoft.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linux.microsoft.com) X-ZM-MESSAGEID: 1754577751223124100 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Daniel P. Berrang=C3=A9 --- accel/Kconfig | 3 +++ meson.build | 10 ++++++++++ meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 18 insertions(+) diff --git a/accel/Kconfig b/accel/Kconfig index 4263cab722..a60f114923 100644 --- a/accel/Kconfig +++ b/accel/Kconfig @@ -13,6 +13,9 @@ config TCG config KVM bool =20 +config MSHV + bool + config XEN bool select FSDEV_9P if VIRTFS diff --git a/meson.build b/meson.build index e53cd5b413..b6e70714f1 100644 --- a/meson.build +++ b/meson.build @@ -334,6 +334,7 @@ elif cpu =3D=3D '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 =20 @@ -884,6 +885,14 @@ accelerators =3D [] if get_option('kvm').allowed() and host_os =3D=3D 'linux' accelerators +=3D 'CONFIG_KVM' endif + +if get_option('mshv').allowed() and host_os =3D=3D 'linux' + if get_option('mshv').enabled() and host_machine.cpu() !=3D 'x86_64' + error('mshv accelerator requires x64_64 host') + endif + accelerators +=3D 'CONFIG_MSHV' +endif + if get_option('whpx').allowed() and host_os =3D=3D 'windows' if get_option('whpx').enabled() and host_machine.cpu() !=3D 'x86_64' error('WHPX requires 64-bit host') @@ -4818,6 +4827,7 @@ if have_system summary_info +=3D {'HVF support': config_all_accel.has_key('CONFIG= _HVF')} summary_info +=3D {'WHPX support': config_all_accel.has_key('CONFIG= _WHPX')} summary_info +=3D {'NVMM support': config_all_accel.has_key('CONFIG= _NVMM')} + summary_info +=3D {'MSHV support': config_all_accel.has_key('CONFI= G_MSHV')} summary_info +=3D {'Xen support': xen.found()} if xen.found() summary_info +=3D {'xen ctrl version': xen.version()} diff --git a/meson_options.txt b/meson_options.txt index dd33530750..2a6e8dd950 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -71,6 +71,8 @@ option('malloc', type : 'combo', choices : ['system', 'tc= malloc', 'jemalloc'], =20 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 d559e260ed..a3bc3d195e 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -157,6 +157,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 passth= rough' + 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' @@ -413,6 +414,8 @@ _meson_option_parse() { --disable-modules) printf "%s" -Dmodules=3Ddisabled ;; --enable-mpath) printf "%s" -Dmpath=3Denabled ;; --disable-mpath) printf "%s" -Dmpath=3Ddisabled ;; + --enable-mshv) printf "%s" -Dmshv=3Denabled ;; + --disable-mshv) printf "%s" -Dmshv=3Ddisabled ;; --enable-multiprocess) printf "%s" -Dmultiprocess=3Denabled ;; --disable-multiprocess) printf "%s" -Dmultiprocess=3Ddisabled ;; --enable-netmap) printf "%s" -Dnetmap=3Denabled ;; --=20 2.34.1