uint64_t features;
uint64_t midr;
uint32_t reset_sctlr;
+ uint32_t sme_vq_supported;
const char *dtb_compatible;
} ARMHostCPUFeatures;
r |= hv_vcpu_config_get_feature_reg(config, regs[i].reg,
&host_isar.idregs[regs[i].index]);
}
+
+ if (__builtin_available(macOS 15.2, *)) {
+ static const struct sme_isar_regs {
+ hv_feature_reg_t reg;
+ ARMIDRegisterIdx index;
+ } sme_regs[] = {
+ { HV_FEATURE_REG_ID_AA64SMFR0_EL1, ID_AA64SMFR0_EL1_IDX },
+ { HV_FEATURE_REG_ID_AA64ZFR0_EL1, ID_AA64ZFR0_EL1_IDX },
+ };
+
+ if (hvf_arm_sme2_supported()) {
+ for (i = 0; i < ARRAY_SIZE(sme_regs); i++) {
+ r |= hv_vcpu_config_get_feature_reg(config, sme_regs[i].reg,
+ &host_isar.idregs[sme_regs[i].index]);
+ }
+ }
+ }
+
os_release(config);
/*
clamp_id_aa64mmfr0_parange_to_ipa_size(&host_isar);
- /*
- * Disable SME, which is not properly handled by QEMU hvf yet.
- * To allow this through we would need to:
- * - make sure that the SME state is correctly handled in the
- * get_registers/put_registers functions
- * - get the SME-specific CPU properties to work with accelerators
- * other than TCG
- * - fix any assumptions we made that SME implies SVE (since
- * on the M4 there is SME but not SVE)
- */
- SET_IDREG(&host_isar, ID_AA64PFR1,
- GET_IDREG(&host_isar, ID_AA64PFR1) & ~R_ID_AA64PFR1_SME_MASK);
-
ahcf->isar = host_isar;
/*
*/
ahcf->reset_sctlr |= 0x00800000;
+ ahcf->sme_vq_supported = hvf_arm_sme2_supported() ? hvf_arm_sme2_get_svl() : 0;
+
/* Make sure we don't advertise AArch32 support for EL0/EL1 */
if ((GET_IDREG(&host_isar, ID_AA64PFR0) & 0xff) != 0x11) {
return false;
cpu->env.features = arm_host_cpu_features.features;
cpu->midr = arm_host_cpu_features.midr;
cpu->reset_sctlr = arm_host_cpu_features.reset_sctlr;
+ cpu->sme_vq.supported = arm_host_cpu_features.sme_vq_supported;
}
void hvf_arch_vcpu_destroy(CPUState *cpu)
arm_cpu->isar.idregs[ID_AA64MMFR0_EL1_IDX]);
assert_hvf_ok(ret);
+ aarch64_add_sme_properties(OBJECT(cpu));
return 0;
}