@samitouri / QOSamiQemu / commits / ca34bcb014

hvf: arm: disable SME when nested virt is active

Currently, Apple doesn't support the nested virtualisation + SME combination. Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20260429190532.26538-13-mohamed@unpredictable.fr Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Mohamed Mediouni committed May 5, 2026 at 09:25 UTC ca34bcb0141db5f380030a33048fbf620d7fea73
2 files changed +10
target/arm/hvf/hvf.c
+5
@@ -1215,6 +1215,11 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
1215 FIELD_DP64_IDREG(&host_isar, ID_AA64DFR0, PMUVER, 0x1);
1216 }
1217
1218 + if (hvf_nested_virt_enabled()) {
1219 + /* SME is not implemented with nested virt on the Apple side */
1220 + FIELD_DP64_IDREG(&host_isar, ID_AA64PFR1, SME, 0);
1221 + }
1222 +
1223 ahcf->isar = host_isar;
1224
1225 /*
target/arm/hvf_arm.h
+5
@@ -11,6 +11,7 @@
11 #ifndef QEMU_HVF_ARM_H
12 #define QEMU_HVF_ARM_H
13
14 +#include "system/hvf.h"
15 #include "target/arm/cpu-qom.h"
16
17 /**
@@ -35,6 +36,10 @@ void hvf_arm_set_cpu_features_from_host(ARMCPU *cpu);
36 if (__builtin_available(macOS 15.2, *)) {
37 size_t svl_bytes;
38 hv_return_t result = hv_sme_config_get_max_svl_bytes(&svl_bytes);
39 + /* Nested virt not supported together with SME right now. */
40 + if (hvf_nested_virt_enabled()) {
41 + return false;
42 + }
43 if (result == HV_UNSUPPORTED) {
44 return false;
45 }