From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.gnu.org (lists.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 317A3CCD19F for ; Thu, 16 Oct 2025 20:22:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1v9UTM-0005fE-G7; Thu, 16 Oct 2025 16:21:16 -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 1v9UTK-0005eK-IM for qemu-devel@nongnu.org; Thu, 16 Oct 2025 16:21:14 -0400 Received: from p-east2-cluster5-host5-snip4-10.eps.apple.com ([57.103.79.93] helo=outbound.st.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v9UTH-0000zn-IJ for qemu-devel@nongnu.org; Thu, 16 Oct 2025 16:21:14 -0400 Received: from outbound.st.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-1a-60-percent-2 (Postfix) with ESMTPS id 2E9B61800114; Thu, 16 Oct 2025 20:21:06 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; bh=hP9mipJJlzEp8BAG964JLQLLOKiV7YupjQ0pPg2yZ4w=; h=From:To:Subject:Date:Message-ID:MIME-Version:x-icloud-hme; b=WwuWxNbfTKZb3l5AWPQAR+bgG55T/YE+RH5cJOTFc+no6DKm2fArAQq3nkWC7Lso3Jo6swRybIcyK+ugfGJyzlteb2YPe6GU9y1wfn6krVqFexRWtMOleJ/w7lGwQG1aaVigOzrB2vUJuyl+6wwhPzAJr/9sQwXC1tAP1IOCIHXxA9A+WTopHdAaG6DMU0sR4RaKlDNRm9rrzuQAVQrosNc3dDbJxlZEN+UxXwd/LIlOAUxiThLf/sjhulWf5iBwN4yGgLILOND1Ig4Y96FyEr1s0UCefi+NsIr4vGNHjtw6N5fGGNKy8AkMiJjreXsPbmRJMVWSDsdHmI+mKZV6YQ== mail-alias-created-date: 1752046281608 Received: from localhost.localdomain (unknown [17.42.251.67]) by p00-icloudmta-asmtp-us-east-1a-60-percent-2 (Postfix) with ESMTPSA id 1DE3318009A0; Thu, 16 Oct 2025 20:21:01 +0000 (UTC) From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: Pedro Barbuda , qemu-arm@nongnu.org, Peter Maydell , Mohamed Mediouni , Paolo Bonzini , Phil Dennis-Jordan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Pierrick Bouvier Subject: [PATCH v9 08/24] whpx: ifdef out winhvemulation on non-x86_64 Date: Thu, 16 Oct 2025 22:20:28 +0200 Message-ID: <20251016202044.75261-9-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20251016202044.75261-1-mohamed@unpredictable.fr> References: <20251016202044.75261-1-mohamed@unpredictable.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: gx1Y9yEN_71leh6ILpg6vDo-spiGAxGy X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMDE2MDE1MSBTYWx0ZWRfX1UxzdgPgggts obmK/jSr67RSIjOFgX5+o5Cvm0Gv9Mhehb7IwARFPYD/pTeQXet8d7sy8+Cj4bfe33UgY1dtJ51 53ZJz45123qQHChGtVWtuydE6wGXBFoXpwD99K4vnaVyTXu7uQspE7e0T23vLWTSHdT/YMW+d68 x4dtRMiR8+E56VLZqIfRDGsAkpCCvMvSlecHUSYnRcbElrl2n0btqEwSAvmcfY1Iae7+zazezaS wc9rznHwrQW8FCgsk3u1GjGhgFu9F+/l34vDOTTkw+bZ7NUP1EXgWMUnU9sUvfg24i2hvrqoA= X-Proofpoint-ORIG-GUID: gx1Y9yEN_71leh6ILpg6vDo-spiGAxGy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-10-16_04,2025-10-13_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=595 clxscore=1030 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506270000 definitions=main-2510160151 X-JNJ: AAAAAAAB4xCFxenragjOFpEdxKbG0Hl549H31LdxIcXqTnYZ91zs8Epik6mI7Mbmnxr44sphlIhAoZwoLuyrCTc6212pqQWTjsLzaEhT2jDOaLDfqMhmraEgJIVVVWW4zYzwlWHiz4bok0tyEBQRsyXnxIbLUMFkRhkprd02z2zgPPzIkf+Z3WDdDWSwPIZ+qiEe91In5kaUBXF5pvBWEgvVEkXN1DBCsNFlqi5YmZ55XjQrI/WYGi+2HP8YjfVb/UXcGP4/jgTv6OhQHBbwugIKbcpIcMmm2X2Woi4UbjvNJsHlv22Elq9IE43w0638argcietLz9/p+9CxeNkJErrvQxYTj0GVddV+wz4tNbwxzTogqqexADHM+N3rDe5gW++jXmhlzNDl3JEzjvRhyssFiVIsyDZx3NhehZF9uO/AxLvfrfAxVqk39rcqnNswen1N/tcOG5x0OkyyGaG40xmmvPbh/SUZZf5UGBdf1UvzWludHtNVDA8ClWw4xv3BQozweFzYxVfFNLez7TQKzm90qKQHxPZLRLllWo7KN03kuaW/WsSiqqfDwtPl64CwERG3qM2gEz1pq+ApRBSRBKBNtd9JKvOjjFgloOhZ+U0zJtoHc4vrrQfYrhQtbuH0EfXb8csJ2Ap7JIwobOrYYgxmYwofRpgSSTMK5WN8SEipYjCxWD/fXzyffxW2+tQ= Received-SPF: pass client-ip=57.103.79.93; envelope-from=mohamed@unpredictable.fr; helo=outbound.st.icloud.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org winhvemulation is x86_64 only. In the future, we might want to get rid of winhvemulation usage entirely. Signed-off-by: Mohamed Mediouni Reviewed-by: Pierrick Bouvier --- accel/whpx/whpx-common.c | 14 ++++++++++++-- include/system/whpx-common.h | 2 ++ include/system/whpx-internal.h | 7 ++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/accel/whpx/whpx-common.c b/accel/whpx/whpx-common.c index 66c9238586..95664a1df7 100644 --- a/accel/whpx/whpx-common.c +++ b/accel/whpx/whpx-common.c @@ -41,7 +41,9 @@ bool whpx_allowed; static bool whp_dispatch_initialized; static HMODULE hWinHvPlatform; +#ifdef __x86_64__ static HMODULE hWinHvEmulation; +#endif struct whpx_state whpx_global; struct WHPDispatch whp_dispatch; @@ -236,8 +238,10 @@ void whpx_destroy_vcpu(CPUState *cpu) struct whpx_state *whpx = &whpx_global; whp_dispatch.WHvDeleteVirtualProcessor(whpx->partition, cpu->cpu_index); +#ifdef __x86_64__ AccelCPUState *vcpu = cpu->accel; whp_dispatch.WHvEmulatorDestroyEmulator(vcpu->emulator); +#endif g_free(cpu->accel); } @@ -412,8 +416,12 @@ static bool load_whp_dispatch_fns(HMODULE *handle, LIST_WINHVPLATFORM_FUNCTIONS(WHP_LOAD_FIELD) break; case WINHV_EMULATION_FNS_DEFAULT: +#ifdef __x86_64__ WHP_LOAD_LIB(WINHV_EMULATION_DLL, hLib) LIST_WINHVEMULATION_FUNCTIONS(WHP_LOAD_FIELD) +#else + g_assert_not_reached(); +#endif break; case WINHV_PLATFORM_FNS_SUPPLEMENTAL: WHP_LOAD_LIB(WINHV_PLATFORM_DLL, hLib) @@ -539,11 +547,11 @@ bool init_whp_dispatch(void) if (!load_whp_dispatch_fns(&hWinHvPlatform, WINHV_PLATFORM_FNS_DEFAULT)) { goto error; } - +#ifdef __x86_64__ if (!load_whp_dispatch_fns(&hWinHvEmulation, WINHV_EMULATION_FNS_DEFAULT)) { goto error; } - +#endif assert(load_whp_dispatch_fns(&hWinHvPlatform, WINHV_PLATFORM_FNS_SUPPLEMENTAL)); whp_dispatch_initialized = true; @@ -553,9 +561,11 @@ error: if (hWinHvPlatform) { FreeLibrary(hWinHvPlatform); } +#ifdef __x86_64__ if (hWinHvEmulation) { FreeLibrary(hWinHvEmulation); } +#endif return false; } diff --git a/include/system/whpx-common.h b/include/system/whpx-common.h index e549c7539c..7a7c607e0a 100644 --- a/include/system/whpx-common.h +++ b/include/system/whpx-common.h @@ -3,7 +3,9 @@ #define SYSTEM_WHPX_COMMON_H struct AccelCPUState { +#ifdef __x86_64__ WHV_EMULATOR_HANDLE emulator; +#endif bool window_registered; bool interruptable; bool ready_for_pic_interrupt; diff --git a/include/system/whpx-internal.h b/include/system/whpx-internal.h index e61375d554..e57d2c8526 100644 --- a/include/system/whpx-internal.h +++ b/include/system/whpx-internal.h @@ -4,8 +4,9 @@ #include #include +#ifdef __x86_64__ #include - +#endif typedef enum WhpxBreakpointState { WHPX_BP_CLEARED = 0, WHPX_BP_SET_PENDING, @@ -98,12 +99,16 @@ void whpx_apic_get(DeviceState *s); /* Define function typedef */ LIST_WINHVPLATFORM_FUNCTIONS(WHP_DEFINE_TYPE) +#ifdef __x86_64__ LIST_WINHVEMULATION_FUNCTIONS(WHP_DEFINE_TYPE) +#endif LIST_WINHVPLATFORM_FUNCTIONS_SUPPLEMENTAL(WHP_DEFINE_TYPE) struct WHPDispatch { LIST_WINHVPLATFORM_FUNCTIONS(WHP_DECLARE_MEMBER) +#ifdef __x86_64__ LIST_WINHVEMULATION_FUNCTIONS(WHP_DECLARE_MEMBER) +#endif LIST_WINHVPLATFORM_FUNCTIONS_SUPPLEMENTAL(WHP_DECLARE_MEMBER) }; -- 2.50.1 (Apple Git-155)