@samitouri / QOSamiQemu / commits / 3d1f1e65c5

hvf: arm: override HV_SYS_REG_MDCR_EL2

In older SDKs, MDCR_EL2 was defined incorrectly. As such, override it with a #define if compiling with an older macOS SDK. This is a workaround because the macOS CI setup we currently rely on has not been kept up to date, to be able to land nested virtualization support. Once CI is updated, the SME stubs can be removed and this commit can be reverted. Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20260501231353.63184-1-mohamed@unpredictable.fr Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Mohamed Mediouni committed May 2, 2026 at 01:13 UTC 3d1f1e65c5cf8f64d67eb255fface3c195b2481a
1 file changed +9
target/arm/hvf/hvf.c
+9
@@ -462,6 +462,15 @@ static const struct hvf_reg_match hvf_sme2_preg_match[] = {
462 #define HVF_TO_KVMID(HVF) \
463 (CP_REG_ARM64 | CP_REG_SIZE_U64 | CP_REG_ARM64_SYSREG | (HVF))
464
465 +/*
466 + * In older SDKs, MDCR_EL2 was defined incorrectly.
467 + * As such, override it with a #define if compiling with an older macOS SDK.
468 + * https://lore.kernel.org/qemu-devel/BCCED674-EAEF-4755-9BE1-116FB36FB5C9@apple.com/
469 + */
470 +#if !defined(MAC_OS_VERSION_26_0)
471 +#define HV_SYS_REG_MDCR_EL2 0xe089
472 +#endif
473 +
474 /*
475 * Verify this at compile-time.
476 *