From nobody Sat Nov 15 22:35:32 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=1747740731; cv=none; d=zohomail.com; s=zohoarc; b=JPTUx71VtEG0VS4RQ9d6Lh1V0T3+gTYPr42gty5KYRT8JPvs5kfdReujJ0S6gInfvOibM3tTX4EzYqox513T8EtRlh1Y+hD2n9g8Evx8wefOu0siqC/e38WhFvnC5QRfRvOQcZfEiJxjBFh0YRXRUIS0dK/03kn8gzrpeEhZO7w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747740731; 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=cUoMgvFdCgsMGM2JauNJvaGF6+KgwzbkP4Dx0XVdoiU=; b=afUgawH4KOLYmfMUSmEkD6GsatFOtZ/Lg1Rwqvmoigb746TfpdBSN74U34AI6fAwNbURqKKuEncvJ/q2t/mXrCNRZwp12ceEI6LSpN4Cq3E64A78PFdN31IOPD7O7LgqtHuM5XShNIsNL+9hVKZftfQKaNQGFnLvUYndfR60yTk= 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 1747740731794569.9984412081376; Tue, 20 May 2025 04:32:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHLBl-000817-9w; Tue, 20 May 2025 07:31:17 -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 1uHLBh-00080e-Ud for qemu-devel@nongnu.org; Tue, 20 May 2025 07:31:15 -0400 Received: from linux.microsoft.com ([13.77.154.182]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uHLBf-00019Q-RY for qemu-devel@nongnu.org; Tue, 20 May 2025 07:31:13 -0400 Received: from DESKTOP-TUU1E5L.fritz.box (unknown [172.201.77.43]) by linux.microsoft.com (Postfix) with ESMTPSA id A3508206789E; Tue, 20 May 2025 04:31:07 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com A3508206789E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1747740670; bh=cUoMgvFdCgsMGM2JauNJvaGF6+KgwzbkP4Dx0XVdoiU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e0G/x4JRFPrHZ0ZGh1SJl53PeHHi+X5YW2IO43dfaQry3p8sdxptjirN9xgqDJdkW SW3FkkKqYnaWy7nyav7HtiluI1Jpa6nw89o7IvfhJJWaGM508OlPba9DW7P3LfmZyB Fp5s2xwT6TXC/QqbxIB8h3TmsmGq+vvzMCPPReJ0= From: Magnus Kulke To: magnuskulke@microsoft.com, qemu-devel@nongnu.org, liuwe@microsoft.com Cc: Paolo Bonzini , "Michael S. Tsirkin" , Wei Liu , Phil Dennis-Jordan , Roman Bolshakov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhao Liu , Richard Henderson , Cameron Esfahani , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [RFC PATCH 01/25] accel: Add Meson and config support for MSHV accelerator Date: Tue, 20 May 2025 13:29:54 +0200 Message-Id: <20250520113018.49569-2-magnuskulke@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250520113018.49569-1-magnuskulke@linux.microsoft.com> References: <20250520113018.49569-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: 1747740734497116600 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 --- accel/Kconfig | 3 +++ meson.build | 16 ++++++++++++++++ meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 4 files changed, 24 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 e819a7084c..a4269b816b 100644 --- a/meson.build +++ b/meson.build @@ -322,6 +322,13 @@ else endif accelerator_targets +=3D { 'CONFIG_XEN': xen_targets } =20 +if cpu =3D=3D 'x86_64' + mshv_targets =3D ['x86_64-softmmu'] +else + mshv_targets =3D [] +endif +accelerator_targets +=3D { 'CONFIG_MSHV': mshv_targets } + if cpu =3D=3D 'aarch64' accelerator_targets +=3D { 'CONFIG_HVF': ['aarch64-softmmu'] @@ -877,6 +884,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') @@ -4747,6 +4762,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 cc66b46c63..e5671884b8 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 8a67a14e2e..cfd767a425 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -155,6 +155,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' @@ -410,6 +411,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