From nobody Tue Apr 7 21:50:02 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=anirudh@anirudhrb.com; 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; arc=pass (i=1 dmarc=pass fromdomain=anirudhrb.com); dmarc=pass(p=none dis=none) header.from=anirudhrb.com ARC-Seal: i=2; a=rsa-sha256; t=1773242745; cv=pass; d=zohomail.com; s=zohoarc; b=Q31TfVMjpEo0X1aEjsp2uZ+phoV3MbhuVMp39sdVy2hCkUtEIfAQUikNJ4tkK+iRR5+DrCqvNHHGJNK0BQiU8VZ+w+PYRMYoVdzaYgI+ePFbytlDge1R6nAdn2z9zpN43Su89K65quC6xs/oOLmJmeB6lox5DlmH2ulzMg5ynAo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773242745; h=Content-Type: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=NTRwQprmaWvdzPDBjKmpFbbwJfCwmByLtqIQGr/R/H0=; b=lOTjGygJv7/B1fTFEVhNUa7VZrpwt7lqk5HFMWrpMBA1t0I6uVQ/Yg3yZd+UY7HBIRSh9tZdzdsnZjvpXG1J5ACY/MS3pXQcjeLc2GxLfUlwUoAo3rVA7UHa0jnIVNyDVGcqQwmpmXcnCnlWyBIy54GPHCcdVdWMKyAv1wkuy6c= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass header.i=anirudh@anirudhrb.com; 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; arc=pass (i=1 dmarc=pass fromdomain=anirudhrb.com); 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 1773242745816820.6712934162495; Wed, 11 Mar 2026 08:25:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w0LK5-0000Zy-91; Wed, 11 Mar 2026 11:18:10 -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 1w0LJt-0000PV-Nt; Wed, 11 Mar 2026 11:18:00 -0400 Received: from sender4-of-o54.zoho.com ([136.143.188.54]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w0LJr-0000nn-1f; Wed, 11 Mar 2026 11:17:56 -0400 Received: by mx.zohomail.com with SMTPS id 1773242189395760.3162595875575; Wed, 11 Mar 2026 08:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773242191; cv=none; d=zohomail.com; s=zohoarc; b=K9ZEe/COHh+kYbqB86pMU0V+0ZL83lD2oMPoy3voVYd2U8N/I3xfCCMEZJiKqMS0PRUBih8kp7L4lPyE+Zw8blyyBkt9KawKpnj7bIAJQ/zMolvBG/TH5+ocQRo5dtsI5xWSC5LCs7Ae0257Z1p14hgfZy3qpICkn/z26hGTITM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773242191; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=NTRwQprmaWvdzPDBjKmpFbbwJfCwmByLtqIQGr/R/H0=; b=KlRluhII3kxOi0UfWaixuQa75jdkXRNnJ9wIs6fWX/FdCimqiTQwUDcuJOJdfyBQ6lJupxBtiD+p6WzOcqXdW9JpVKJGirGB7lPjP1ofEPyZDyXxW19T7ibaK2806N2ULZE2BHVDXUlpFJ+/wJg0gbDY5QwgsKoQq+lD56tKgUA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=anirudhrb.com; spf=pass smtp.mailfrom=anirudh@anirudhrb.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1773242191; s=zoho; d=anirudhrb.com; i=anirudh@anirudhrb.com; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:References:In-Reply-To:To:To:Cc:Cc:Reply-To; bh=NTRwQprmaWvdzPDBjKmpFbbwJfCwmByLtqIQGr/R/H0=; b=Jn2tPs3TmwhTa78C5KkZAD0NSD4KL/bxFV0bapaEWzrqwPjSkxTFAJ1dj5YYc+SM fIg7ouD+t9UKKs7RThU3j1RP5TD2BZNJWDcEaXNU+PXrqWKZ8PhoMzuyCW3Jp/WxwIu 3LomBLaMG3113c7lB5CtDO2zfgwSWd474Ny3mh+w= From: Anirudh Rayabharam Date: Wed, 11 Mar 2026 15:15:31 +0000 Subject: [PATCH 04/14] meson, target/arm/mshv: Enable arm64 build & add initial MSHV support MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260311-mshv_accel_arm64_supp-v1-4-c31699b7bc1f@anirudhrb.com> References: <20260311-mshv_accel_arm64_supp-v1-0-c31699b7bc1f@anirudhrb.com> In-Reply-To: <20260311-mshv_accel_arm64_supp-v1-0-c31699b7bc1f@anirudhrb.com> To: qemu-devel@nongnu.org Cc: Magnus Kulke , Wei Liu , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Anirudh Rayabharam , Aastha Rawat , qemu-arm@nongnu.org X-Mailer: b4 0.14.3 X-ZohoMailClient: External 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=136.143.188.54; envelope-from=anirudh@anirudhrb.com; helo=sender4-of-o54.zoho.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.819, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.903, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development 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 anirudh@anirudhrb.com) X-ZM-MESSAGEID: 1773242747846158500 From: Aastha Rawat Enable the build of the MSHV accelerator for arm64 in the Meson build system. Introduce initial files and stub implementations to support MSHV for the ARM target. Signed-off-by: Aastha Rawat --- meson.build | 7 +++--- target/arm/meson.build | 1 + target/arm/mshv/meson.build | 7 ++++++ target/arm/mshv/mshv-all.c | 54 +++++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 66 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index ed82247111..bf12fda40f 100644 --- a/meson.build +++ b/meson.build @@ -303,7 +303,8 @@ if cpu =3D=3D 'aarch64' accelerator_targets +=3D { 'CONFIG_HVF': ['aarch64-softmmu'], 'CONFIG_NITRO': ['aarch64-softmmu'], - 'CONFIG_WHPX': ['aarch64-softmmu'] + 'CONFIG_WHPX': ['aarch64-softmmu'], + 'CONFIG_MSHV': ['aarch64-softmmu'], } elif cpu =3D=3D 'x86_64' accelerator_targets +=3D { @@ -855,8 +856,8 @@ if get_option('kvm').allowed() and host_os =3D=3D 'linu= x' endif =20 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') + if get_option('mshv').enabled() and not (host_machine.cpu() in [ 'x86_64= ', 'aarch64' ]) + error('The mshv accelerator requires an x86_64 or aarch64 host') endif accelerators +=3D 'CONFIG_MSHV' endif diff --git a/target/arm/meson.build b/target/arm/meson.build index 6e0e504a40..8aa8cac137 100644 --- a/target/arm/meson.build +++ b/target/arm/meson.build @@ -59,6 +59,7 @@ arm_common_system_ss.add(files( =20 subdir('hvf') subdir('whpx') +subdir('mshv') =20 if 'CONFIG_TCG' in config_all_accel subdir('tcg') diff --git a/target/arm/mshv/meson.build b/target/arm/mshv/meson.build new file mode 100644 index 0000000000..169643691e --- /dev/null +++ b/target/arm/mshv/meson.build @@ -0,0 +1,7 @@ +arm_mshv_ss =3D ss.source_set() + +arm_mshv_ss.add(files( + 'mshv-all.c', +)) + +arm_system_ss.add_all(when: 'CONFIG_MSHV', if_true: arm_mshv_ss) diff --git a/target/arm/mshv/mshv-all.c b/target/arm/mshv/mshv-all.c new file mode 100644 index 0000000000..1c82e2c593 --- /dev/null +++ b/target/arm/mshv/mshv-all.c @@ -0,0 +1,54 @@ +/* + * QEMU MSHV support + * + * Copyright Microsoft, Corp. 2026 + * + * Authors: Aastha Rawat + * Anirudh Rayabharam + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "system/mshv.h" +#include "system/mshv_int.h" + +int mshv_load_regs(CPUState *cpu) +{ + return 0; +} + +int mshv_arch_put_registers(const CPUState *cpu) +{ + return 0; +} + +int mshv_run_vcpu(int vm_fd, CPUState *cpu, hv_message *msg, MshvVmExit *e= xit) +{ + return 0; +} + +void mshv_arch_init_vcpu(CPUState *cpu) +{ + +} + +void mshv_arch_destroy_vcpu(CPUState *cpu) +{ + +} + +void mshv_init_mmio_emu(void) +{ + +} + +void mshv_arch_amend_proc_features( + union hv_partition_synthetic_processor_features *features) +{ + +} + +int mshv_arch_post_init_vm(int vm_fd) +{ + return 0; +} --=20 2.43.0