From nobody Tue Apr 7 21:48:16 2026 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=1775137695; cv=none; d=zohomail.com; s=zohoarc; b=YwUkmHu99R3SLvSJw/gV8QnCzI5SIh8AbMeRYASd5k0MesisQhpsfpiddZEq+dE6foawWr/IQ/0CyEUeqY5f7KJB9PAfeXFa0myygcf6bXVqWhaQTiNEzPATIgKflgogGUwibFEXyYxfxXdL5UTrCT8FOYq1k2AJ016SEb7lS9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1775137695; 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=m0k2+p45IxRoR7EBbAy9Rxxi2hTnQ1VuZluHvqCqsIY=; b=ATlhzpakAyA79oAr0w43ZjdG5PA10w74tHJRDVi6HrcIH/RnCYmUUS0IPWwjgkL6Wwf4FErEVU4shsTP6ydpaN07dYY5Xrrx3x8vZFA8ZEOgiRrpxhlIlGq07jDsp7vYsNR1e4fDk0YsRe3mq/5xvbiiQAbIY5kjNzOBko/Lgkk= 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 1775137695407210.29792401197585; Thu, 2 Apr 2026 06:48:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w8ILJ-0008PO-1D; Thu, 02 Apr 2026 09:44: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 1w8IKx-0004lE-O1; Thu, 02 Apr 2026 09:43:55 -0400 Received: from linux.microsoft.com ([13.77.154.182]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w8HXl-0008QZ-JN; Thu, 02 Apr 2026 08:53:08 -0400 Received: from localhost (unknown [131.107.147.136]) by linux.microsoft.com (Postfix) with ESMTPSA id 23C5D20B7136; Thu, 2 Apr 2026 05:53:00 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 23C5D20B7136 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1775134380; bh=m0k2+p45IxRoR7EBbAy9Rxxi2hTnQ1VuZluHvqCqsIY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=mqL0UB4qvak1Chc5pYRIuja6w5Vt4dCsuZ3sCNXraeoVACXlJUOSD6acpuPH+1LMi DEEXUOwEyGy0vMFJmzf++Fmxv+wdlKzu5qXoDtn5IOmP5DeCpri2MVpRrP2N64MtdB T3W1BrbQ2ACzwzif6kQ7q7QJataszzwOnxgVybUk= From: Aastha Rawat Date: Thu, 02 Apr 2026 12:52:30 +0000 Subject: [PATCH v2 03/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: <20260402-mshv_accel_arm64_supp-v2-3-754895c15e9e@linux.microsoft.com> References: <20260402-mshv_accel_arm64_supp-v2-0-754895c15e9e@linux.microsoft.com> In-Reply-To: <20260402-mshv_accel_arm64_supp-v2-0-754895c15e9e@linux.microsoft.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 , Magnus Kulke , qemu-arm@nongnu.org, Alexander Graf , Pedro Barbuda , Mohamed Mediouni X-Mailer: b4 0.15.1 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=aastharawat@linux.microsoft.com; helo=linux.microsoft.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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: 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 @linux.microsoft.com) X-ZM-MESSAGEID: 1775137697930154100 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.45.4