From nobody Sat Nov 15 01:19:16 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=1758041571; cv=none; d=zohomail.com; s=zohoarc; b=IedjUlkG57UyAgksyUEMoPuTB9mWAfHQE2Ez0IzeQlNk/XwGMlladto71vKlWrsXJTXGQCSAAEYjm6T95+01gG0/EQyxf/bSRa47Tuo+qQ/pp132DAmNPO/IU5nnRcRbRAXYzJtb78NnNJidyf4oV1hvHzyi6tsl1ffJoZzqsPg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1758041571; 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=8KammitWYqIpX7N3FRxNLCjC3grTl49hco37a6bOKoE=; b=PNxu34Ttk6MwSi4F1Xi2VPYdAQsyxfW/EBkA5bllCFBhsZX4yyMGpF3VZmRzA21depQsKElRtFAwHnsREKxEsA06Y20CCidUp2NkNFvVp8LlKcxfX5O97XXpTh61R5nwK9shC9XKBZOb8chUu8GAQV9XZfVudLR4PjDtiDVt1bQ= 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 1758041571914935.2087748236474; Tue, 16 Sep 2025 09:52:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyYru-0008HM-1U; Tue, 16 Sep 2025 12:49:26 -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 1uyYrs-0008Fx-6J for qemu-devel@nongnu.org; Tue, 16 Sep 2025 12:49:24 -0400 Received: from linux.microsoft.com ([13.77.154.182]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uyYrq-0006QO-7w for qemu-devel@nongnu.org; Tue, 16 Sep 2025 12:49:23 -0400 Received: from localhost.localdomain (unknown [167.220.208.43]) by linux.microsoft.com (Postfix) with ESMTPSA id 68D38201551D; Tue, 16 Sep 2025 09:49:16 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 68D38201551D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1758041360; bh=8KammitWYqIpX7N3FRxNLCjC3grTl49hco37a6bOKoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qH/aY9byeYhPX3rGnzf9xyHHUeZ6ufwXh81wbTFCzYu62ggsQK6UGjM14JGlw2p/j +CPl2trUvXZn47B9uKuoPKMZ9JCpqjvJABoVDtXe4jLPkF1IErXW1aVKSP4+pI4MPv nBhKnH1zD6Uomy1UMEgRVmqy2fSi1oSLwwsciaPQ= From: Magnus Kulke To: qemu-devel@nongnu.org Cc: Markus Armbruster , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cameron Esfahani , Paolo Bonzini , Thomas Huth , Richard Henderson , Wei Liu , Cornelia Huck , "Michael S. Tsirkin" , "Dr. David Alan Gilbert" , Roman Bolshakov , Phil Dennis-Jordan , Marcel Apfelbaum , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Zhao Liu , Eduardo Habkost , Magnus Kulke , Wei Liu , Eric Blake , Yanan Wang , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v4 01/27] accel: Add Meson and config support for MSHV accelerator Date: Tue, 16 Sep 2025 18:48:21 +0200 Message-Id: <20250916164847.77883-2-magnuskulke@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250916164847.77883-1-magnuskulke@linux.microsoft.com> References: <20250916164847.77883-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_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_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: 1758041573987116600 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 3d73873356..6bd1d897e3 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 @@ -880,6 +881,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') @@ -4821,6 +4830,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('CONFIG= _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 fff1521e58..1be7d61efd 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 0ebe6bc52a..d3d8f48bbb 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 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' @@ -408,6 +409,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