From nobody Sat Nov 15 14:52:45 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=1751390967; cv=none; d=zohomail.com; s=zohoarc; b=GPF9WcOxTUI3oOcLTKc6QAn8nbdqVrMaioxUvij20D/zPxkqAUxQy2FfXmdcGlG1J71sT+6N+ykerrUO74BWy6vbYdX+PMFsiXY0+26zRg4vIcwFf3XrbFOBuQX+0FnNGUPYsscFkMfvEXPYOhKtvwbs7OBDG9TylghhXHYLdzk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751390967; 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=5XVtskIyehqzUfzD7n3E/UoVw7FlSFU9LC3s1SxuJo8=; b=B/58wtIaoLJ1FoQbFDHls/IaGIiDsqfDcqnKrvja9jtMzoESj/wF8qShIi9ZV+m1Pv1Sai8LsQ8g7JV/yRgg6BUZKNYtOyWbuNPSM9FFeqvZaaeJejuXIdjkI2kPbjMsyT9Pi89F/E1RHgj0CPk0a/L0A0UHkgiTbcR7ErERur8= 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 1751390967503873.332079660936; Tue, 1 Jul 2025 10:29:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uWen9-0002QS-LO; Tue, 01 Jul 2025 13:29:11 -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 1uWen7-0002PQ-ET for qemu-devel@nongnu.org; Tue, 01 Jul 2025 13:29:09 -0400 Received: from linux.microsoft.com ([13.77.154.182]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uWen5-0006SY-CF for qemu-devel@nongnu.org; Tue, 01 Jul 2025 13:29:09 -0400 Received: from localhost.localdomain (unknown [167.220.208.67]) by linux.microsoft.com (Postfix) with ESMTPSA id AA0A72112219; Tue, 1 Jul 2025 10:29:02 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AA0A72112219 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1751390946; bh=5XVtskIyehqzUfzD7n3E/UoVw7FlSFU9LC3s1SxuJo8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZLg7V7Ye3T7iGGRp6ZdEpUG03EgcuLUyy/nClTiUBESu2BuZqXPf+HUA8K7FsPz/x NrcSjjynAxfrTr9irAI1hKXzDEfnS2V+SiuUOSD9LCDrWNzAnrfP/Esgn6+m2+vqFm UuTP9YhnbrJLclbVeLBxWa4ozSqbBrMbDeuyjaJk= From: Magnus Kulke To: qemu-devel@nongnu.org Cc: Cameron Esfahani , Phil Dennis-Jordan , Roman Bolshakov , Thomas Huth , Zhao Liu , Wei Liu , Paolo Bonzini , Wei Liu , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Markus Armbruster , Cornelia Huck , Magnus Kulke , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , "Michael S. Tsirkin" , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v2 01/27] accel: Add Meson and config support for MSHV accelerator Date: Tue, 1 Jul 2025 19:28:08 +0200 Message-Id: <20250701172834.44849-2-magnuskulke@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250701172834.44849-1-magnuskulke@linux.microsoft.com> References: <20250701172834.44849-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: 1751390968716116600 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 | 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 dbc97bfdf7..927f3474ea 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') @@ -4797,6 +4806,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 a442be2995..1c02a4f54b 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 73e0770f42..d21bf4dc33 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -153,6 +153,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' @@ -404,6 +405,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