Skip to contentSkip to conversation

hvf: arm: disable SME feature

PATCH In review Joelle van Dyne 2 participants 2 messages Feb 24, 2025 – Feb 25, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hvf: arm: disable SME feature

macOS 15.2's Hypervisor.framework exposes SME feature on M4 Macs. However, HVF does not properly support it yet causing QEMU to fail to start when HVF accelerator is used on these systems.

---
 target/arm/hvf/hvf.c | 5 +++++
 1 file changed, 5 insertions(+)
target/arm/hvf/hvf.c +5 -0
index 0afd96018e..261db2d227 100644
@@ -899,6 +899,11 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
 
     clamp_id_aa64mmfr0_parange_to_ipa_size(&host_isar.id_aa64mmfr0);
 
+    /*
+     * Disable SME which is not properly handled by QEMU yet
+     */
+    host_isar.id_aa64pfr1 &= ~R_ID_AA64PFR1_SME_MASK;
+
     ahcf->isar = host_isar;
 
     /*
Signature · 1 line
2.41.0
#1 lore raw
Quoted 15 lines · Joelle van Dyne

macOS 15.2's Hypervisor.framework exposes SME feature on M4 Macs. However, HVF does not properly support it yet causing QEMU to fail to start when HVF accelerator is used on these systems.

---
 target/arm/hvf/hvf.c | 5 +++++
 1 file changed, 5 insertions(+)
target/arm/hvf/hvf.c +0 -0
index 0afd96018e..261db2d227 100644

target/arm/hvf/hvf.c static bool hvf_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf) · line 907

Quoted 9 lines
target/arm/hvf/hvf.c +5 -0
@@ -899,6 +899,11 @@ static bool hvf_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
 
     clamp_id_aa64mmfr0_parange_to_ipa_size(&host_isar.id_aa64mmfr0);
 
+    /*
+     * Disable SME which is not properly handled by QEMU yet
+     */
+    host_isar.id_aa64pfr1 &= ~R_ID_AA64PFR1_SME_MASK;
+
     ahcf->isar = host_isar;

Thanks for sending in this patch; I've applied it to target-arm.next. I expanded the comment a bit to add my understanding of what pieces are missing in QEMU to support this, and threw in a cc:stable so we can get this backported to the stable release branches.

-- PMM