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 59707C87FD3 for ; Fri, 8 Aug 2025 06:54:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ukGzz-00015i-5C; Fri, 08 Aug 2025 02:54:43 -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 1ukGzt-000122-Bg for qemu-arm@nongnu.org; Fri, 08 Aug 2025 02:54:37 -0400 Received: from p-east3-cluster2-host10-snip4-10.eps.apple.com ([57.103.87.231] helo=outbound.qs.icloud.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ukGzq-00040w-Vp for qemu-arm@nongnu.org; Fri, 08 Aug 2025 02:54:37 -0400 Received: from outbound.qs.icloud.com (unknown [127.0.0.2]) by p00-icloudmta-asmtp-us-east-2d-100-percent-10 (Postfix) with ESMTPS id BFDF418000A4; Fri, 8 Aug 2025 06:54:25 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unpredictable.fr; s=sig1; bh=5UP37bLA03IVQKnrTOUXfFBRG+U+dp8nCZKv85W44Qw=; h=From:To:Subject:Date:Message-Id:MIME-Version:Content-Type:x-icloud-hme; b=ARd4Zt1/irljOGca2eU1tKwQTPuO4ob2/P19TL3THwG3LxZQwkJn73HVRQhWEW+z2mUR25MZweZHvTBt3RujIIpE4KTFT4IXUouWMr7BF+x+qJvQFkUYMAjiNebtgZ2kKQHMWiyWbnq+TbxjiudRnXkZlMIO9DEbrlyv0pmbfKzzgllhGUIdrrbJoOySQvcsDLrNKDp+vpOpaIK5QJBoF8H1zMZPtviuc5ljCCkeSt0CdQ6tZFnMt1EfkUySJ5os9zBsAGcMOFhs7krbrwQyr4w9iG1g1JdtNotmaU/8MIdCoR9bf8mawZZpT9hp2A6ahu01HpC6DcqEb8YfzxtcrQ== X-Client-IP: 46.189.47.18 Received: from localhost.localdomain (qs-asmtp-me-k8s.p00.prod.me.com [17.57.155.37]) by p00-icloudmta-asmtp-us-east-2d-100-percent-10 (Postfix) with ESMTPSA id 057731800107; Fri, 8 Aug 2025 06:54:21 +0000 (UTC) From: Mohamed Mediouni To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Igor Mammedov , Richard Henderson , Roman Bolshakov , Phil Dennis-Jordan , Ani Sinha , "Michael S. Tsirkin" , Alexander Graf , Peter Maydell , Mads Ynddal , Sunil Muthuswamy , Zhao Liu , Marcel Apfelbaum , Eduardo Habkost , Cameron Esfahani , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Shannon Zhao , Mohamed Mediouni , qemu-arm@nongnu.org, Yanan Wang Subject: [PATCH v5 00/18] WHPX support for Arm Date: Fri, 8 Aug 2025 08:54:01 +0200 Message-Id: <20250808065419.47415-1-mohamed@unpredictable.fr> X-Mailer: git-send-email 2.39.5 (Apple Git-154) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwODA4MDA1NiBTYWx0ZWRfXxZFyQXDocmqh G7RWaD0sSdR9c3equAXgKPBNiCKNjV66HhqO+QojywTvVVrAjST40jJcm4apqqPS/LpePhEx01n Ukn4tkzpWxqTFJDzjVmuCfgSyN8Hs5DpFigFy10j0PFpkAdh1SLNYTV84j+l6xlqbRzgsCKRMN1 f1k+buotg6x/1KO9ga6QRTL4cf6GwVHTKiitTCjGFcBzWhYOpYwA9t5NfvA5y5ctuL1+wnXJp2J /nps1mJ12Blg7sH9eD0KoTnIrAH5/NnnEB+I+6Te1MJ6YcKJ8cgOhTCT2VYcXTDWQ7+oitKNA= X-Proofpoint-ORIG-GUID: y81SXZ7n2cxMUdClKW6id5GSYIyF88KB X-Proofpoint-GUID: y81SXZ7n2cxMUdClKW6id5GSYIyF88KB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-08-08_01,2025-08-06_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 bulkscore=0 clxscore=1030 spamscore=0 mlxscore=0 suspectscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506270000 definitions=main-2508080056 Received-SPF: pass client-ip=57.103.87.231; envelope-from=mohamed@unpredictable.fr; helo=outbound.qs.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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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 Link to branch: https://github.com/mediouni-m/qemu whpx (tag for this submission: whpx-v5) Missing features: - PSCI state sync with Hyper-V: notably breaks reboots when multiple cores are enabled - Interrupt controller save-restore - SVE register sync To do: - Switching ITS to off by default when using HVF w/ vGIC or WHPX (will probably do when both the series are merged) - After that, perhaps exit if ITS is explicitly enabled. Note: "accel/system: Introduce hwaccel_enabled() helper" taken from the mailing list, added here as part of this series to make it compilable as a whole. "hw/arm: virt: add GICv2m for the case when ITS is not available" present in both the HVF vGIC and this series. Updates since v4: - Taking into account review comments - Add migration blocker in the vGICv3 code due to missing interrupt controller save/restore - Debug register sync Updates since v3: - Disabling SVE on WHPX - Taking into account review comments incl: - fixing x86 support - reduce the amount of __x86_64__ checks in common code to the minimum (winhvemulation) which can be reduced even further down the road. - generalize get_physical_address_range into something common between hvf and whpx Updates since v2: - Fixed up a rebase screwup for whpx-internal.h - Fixed ID_AA64ISAR1_EL1 and ID_AA64ISAR2_EL1 feature probe for -cpu host - Switched to ID_AA64PFR1_EL1/ID_AA64DFR0_EL1 instead of their non-AA64 variant Updates since v1: - Shutdowns and reboots - MPIDR_EL1 register sync - Fixing GICD_TYPER_LPIS value - IPA size clamping - -cpu host now implemented Mohamed Mediouni (17): hw/arm: virt: add GICv2m for the case when ITS is not available whpx: Move around files before introducing AArch64 support whpx: reshuffle common code whpx: ifdef out winhvemulation on non-x86_64 whpx: common: add WHPX_INTERCEPT_DEBUG_TRAPS define hw, target, accel: whpx: change apic_in_platform to kernel_irqchip whpx: interrupt controller support whpx: add arm64 support whpx: copy over memory management logic from hvf target/arm: cpu: mark WHPX as supporting PSCI 1.1 hw/arm: virt: cleanly fail on attempt to use the platform vGIC together with ITS whpx: arm64: clamp down IPA size hw/arm, accel/hvf, whpx: unify get_physical_address_range between WHPX and HVF whpx: arm64: implement -cpu host target/arm: whpx: instantiate GIC early whpx: arm64: gicv3: add migration blocker MAINTAINERS: Add myself as a maintainer for WHPX Philippe Mathieu-Daudé (1): accel/system: Introduce hwaccel_enabled() helper MAINTAINERS | 9 +- accel/hvf/hvf-all.c | 7 +- accel/meson.build | 1 + accel/whpx/meson.build | 7 + {target/i386 => accel}/whpx/whpx-accel-ops.c | 6 +- accel/whpx/whpx-common.c | 666 +++++++++++ hw/arm/virt-acpi-build.c | 4 +- hw/arm/virt.c | 34 +- hw/i386/x86-cpu.c | 4 +- hw/intc/arm_gicv3_common.c | 3 + hw/intc/arm_gicv3_whpx.c | 272 +++++ hw/intc/meson.build | 1 + include/hw/arm/virt.h | 2 + include/hw/boards.h | 3 +- include/hw/intc/arm_gicv3_common.h | 3 + include/system/hvf_int.h | 2 + include/system/hw_accel.h | 13 + .../whpx => include/system}/whpx-accel-ops.h | 4 +- include/system/whpx-all.h | 20 + include/system/whpx-common.h | 26 + .../whpx => include/system}/whpx-internal.h | 14 +- include/system/whpx.h | 4 +- meson.build | 21 +- target/arm/cpu.c | 3 +- target/arm/cpu64.c | 19 +- target/arm/hvf-stub.c | 20 - target/arm/hvf/hvf.c | 6 +- target/arm/hvf_arm.h | 3 - target/arm/meson.build | 2 +- target/arm/whpx/meson.build | 5 + target/arm/whpx/whpx-all.c | 1025 +++++++++++++++++ target/arm/whpx/whpx-stub.c | 15 + target/arm/whpx_arm.h | 17 + target/i386/cpu-apic.c | 2 +- target/i386/hvf/hvf.c | 11 + target/i386/whpx/meson.build | 1 - target/i386/whpx/whpx-all.c | 569 +-------- target/i386/whpx/whpx-apic.c | 2 +- 38 files changed, 2207 insertions(+), 619 deletions(-) create mode 100644 accel/whpx/meson.build rename {target/i386 => accel}/whpx/whpx-accel-ops.c (96%) create mode 100644 accel/whpx/whpx-common.c create mode 100644 hw/intc/arm_gicv3_whpx.c rename {target/i386/whpx => include/system}/whpx-accel-ops.h (92%) create mode 100644 include/system/whpx-all.h create mode 100644 include/system/whpx-common.h rename {target/i386/whpx => include/system}/whpx-internal.h (96%) delete mode 100644 target/arm/hvf-stub.c create mode 100644 target/arm/whpx/meson.build create mode 100644 target/arm/whpx/whpx-all.c create mode 100644 target/arm/whpx/whpx-stub.c create mode 100644 target/arm/whpx_arm.h -- 2.39.5 (Apple Git-154)