Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBA1BCD4F54 for ; Wed, 27 May 2026 05:02:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wS6Nv-0001FL-Fq; Wed, 27 May 2026 01:00:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wS6Nt-0001Dp-O7; Wed, 27 May 2026 01:00:49 -0400 Received: from linux.microsoft.com ([13.77.154.182]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wS6Nr-0004De-Uu; Wed, 27 May 2026 01:00:49 -0400 Received: from localhost (unknown [131.107.147.136]) by linux.microsoft.com (Postfix) with ESMTPSA id 4F59D20B716A; Tue, 26 May 2026 22:00:36 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4F59D20B716A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1779858036; bh=qtlP0uBJP+8WkJRoY5C7ajRNqn+hFDb3SPRaB45GNYc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=HpVvhJ6mW/7ZXqo0GhIDHNIk+9o6LokJeZqgkc0qJtZjRYFOY1r+8b/rqY8nsiT2C yEJjWi2aioSohJJlG+qZTO/MZ8IJliYKmEk4adKSTLrmbNPqKlJm6FAZerQEJ5IzP0 pxqWcLGxGt+a0zXJZr2IHsrxgrmaszyo5lb6SsAc= From: Aastha Rawat Date: Wed, 27 May 2026 05:00:40 +0000 Subject: [PATCH v4 04/15] 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: 7bit Message-Id: <20260527-mshv_accel_arm64_supp-v4-4-66d871dcdc53@linux.microsoft.com> References: <20260527-mshv_accel_arm64_supp-v4-0-66d871dcdc53@linux.microsoft.com> In-Reply-To: <20260527-mshv_accel_arm64_supp-v4-0-66d871dcdc53@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 , qemu-arm@nongnu.org, Alexander Graf , Pedro Barbuda , Mohamed Mediouni , =?utf-8?q?Doru_Bl=C3=A2nzeanu?= , Pierrick Bouvier , Magnus Kulke X-Mailer: b4 0.15.1 Received-SPF: pass client-ip=13.77.154.182; envelope-from=aastharawat@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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@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-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org 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 | 8 +++---- target/arm/meson.build | 1 + target/arm/mshv/meson.build | 7 ++++++ target/arm/mshv/mshv-all.c | 56 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index eb07491819..ff54d48e6e 100644 --- a/meson.build +++ b/meson.build @@ -305,7 +305,8 @@ if cpu == 'aarch64' accelerator_targets += { 'CONFIG_HVF': ['aarch64-softmmu'], 'CONFIG_NITRO': ['aarch64-softmmu'], - 'CONFIG_WHPX': ['aarch64-softmmu'] + 'CONFIG_WHPX': ['aarch64-softmmu'], + 'CONFIG_MSHV': ['aarch64-softmmu'], } elif cpu == 'x86_64' accelerator_targets += { @@ -871,10 +872,9 @@ if get_option('kvm').allowed() and host_os == 'linux' endif if get_option('mshv').allowed() and host_os == 'linux' - if get_option('mshv').enabled() and host_machine.cpu() != 'x86_64' - error('mshv accelerator requires x64_64 host') + if host_machine.cpu() in [ 'x86_64', 'aarch64' ] + accelerators += 'CONFIG_MSHV' endif - accelerators += 'CONFIG_MSHV' endif if get_option('whpx').allowed() and host_os == 'windows' diff --git a/target/arm/meson.build b/target/arm/meson.build index 4723f9f170..74d21544b9 100644 --- a/target/arm/meson.build +++ b/target/arm/meson.build @@ -58,6 +58,7 @@ arm_common_system_ss.add(files( subdir('hvf') subdir('whpx') +subdir('mshv') 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 = 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..32adf26838 --- /dev/null +++ b/target/arm/mshv/mshv-all.c @@ -0,0 +1,56 @@ +/* + * QEMU MSHV support + * + * Copyright Microsoft, Corp. 2026 + * + * Authors: Aastha Rawat + * Anirudh Rayabharam + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "hw/arm/virt.h" +#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 *exit) +{ + return 0; +} + +void mshv_arch_init_vcpu(CPUState *cpu) +{ + +} + +void mshv_arch_destroy_vcpu(CPUState *cpu) +{ + +} + +int mshv_arch_accel_init(AccelState *as, MachineState *ms, int mshv_fd) +{ + return 0; +} + +void mshv_arch_amend_proc_features( + union hv_partition_synthetic_processor_features *features) +{ + +} + +int mshv_arch_post_init_vm(int vm_fd) +{ + return 0; +} -- 2.45.4