Hi Mohamed,

On 28/7/25 15:41, Mohamed Mediouni wrote:
Creating a vCPU locks out APIs such as hv_gic_create().

As a result, switch to using the hv_vcpu_config_get_feature_reg interface.

Hardcode MIDR because Apple deliberately doesn't expose a divergent MIDR across 
systems.

Signed-off-by: Mohamed Mediouni <moha...@unpredictable.fr>
---
  target/arm/hvf/hvf.c | 35 ++++++++++++++---------------------
  1 file changed, 14 insertions(+), 21 deletions(-)


@@ -891,17 +891,10 @@ static bool 
hvf_arm_get_host_cpu_features(ARMHostCPUFeatures *ahcf)
                       (1ULL << ARM_FEATURE_PMU) |
                       (1ULL << ARM_FEATURE_GENERIC_TIMER);
- /* We set up a small vcpu to extract host registers */
-
-    if (hv_vcpu_create(&fd, &exit, NULL) != HV_SUCCESS) {
-        return false;
-    }
-
      for (i = 0; i < ARRAY_SIZE(regs); i++) {
-        r |= hv_vcpu_get_sys_reg(fd, regs[i].reg, regs[i].val);
+        r |= hv_vcpu_config_get_feature_reg(hv_vcpu_config, regs[i].reg, 
regs[i].val);
      }
-    r |= hv_vcpu_get_sys_reg(fd, HV_SYS_REG_MIDR_EL1, &ahcf->midr);
-    r |= hv_vcpu_destroy(fd);
Could we add a comment explaining this magic value?

+    ahcf->midr = 0x610f0000;

Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>
Tested-by: Philippe Mathieu-Daudé <phi...@linaro.org>


Reply via email to