]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hvf: arm: disable SME when nested virt is active
authorMohamed Mediouni <mohamed@unpredictable.fr>
Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 5 May 2026 08:30:12 +0000 (09:30 +0100)
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>
target/arm/hvf/hvf.c
target/arm/hvf_arm.h

index 75f0409a71da0b0979f07dd7be88db0b838c6d33..c2bce511fcf34c324e256d01b73e482805bc7d43 100644 (file)
@@ -1215,6 +1215,11 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
         FIELD_DP64_IDREG(&host_isar, ID_AA64DFR0, PMUVER, 0x1);
     }
 
+    if (hvf_nested_virt_enabled()) {
+        /* SME is not implemented with nested virt on the Apple side */
+        FIELD_DP64_IDREG(&host_isar, ID_AA64PFR1, SME, 0);
+    }
+
     ahcf->isar = host_isar;
 
     /*
index 8029d48caf569f174852f70ef1b7903bb2072630..59e19f6e847c5cc9ddb2374cff8ef1879d82fe50 100644 (file)
@@ -11,6 +11,7 @@
 #ifndef QEMU_HVF_ARM_H
 #define QEMU_HVF_ARM_H
 
+#include "system/hvf.h"
 #include "target/arm/cpu-qom.h"
 
 /**
@@ -35,6 +36,10 @@ void hvf_arm_set_cpu_features_from_host(ARMCPU *cpu);
         if (__builtin_available(macOS 15.2, *)) {
             size_t svl_bytes;
             hv_return_t result = hv_sme_config_get_max_svl_bytes(&svl_bytes);
+            /* Nested virt not supported together with SME right now. */
+            if (hvf_nested_virt_enabled()) {
+                return false;
+            }
             if (result == HV_UNSUPPORTED) {
                 return false;
             }