Hi Mohamed, Cameron,

On 31/10/25 19:33, Peter Maydell wrote:
From: Philippe Mathieu-Daudé <[email protected]>

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Mads Ynddal <[email protected]>
Signed-off-by: Peter Maydell <[email protected]>
---
  target/arm/hvf/hvf.c | 38 ++++++++++++++++++++------------------
  1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
index 27c600148f9..79861dcacf9 100644
--- a/target/arm/hvf/hvf.c
+++ b/target/arm/hvf/hvf.c
@@ -2013,30 +2013,32 @@ int hvf_arch_vcpu_exec(CPUState *cpu)
      int ret;
      hv_return_t r;
- if (!(cpu->singlestep_enabled & SSTEP_NOIRQ) &&
-        hvf_inject_interrupts(cpu)) {
-        return EXCP_INTERRUPT;
-    }
-
      if (cpu->halted) {
          return EXCP_HLT;
      }
flush_cpu_state(cpu); - bql_unlock();
-    r = hv_vcpu_run(cpu->accel->fd);
-    bql_lock();
-    switch (r) {
-    case HV_SUCCESS:
-        ret = hvf_handle_vmexit(cpu, cpu->accel->exit);
-        break;
-    case HV_ILLEGAL_GUEST_STATE:
-        trace_hvf_illegal_guest_state();
-        /* fall through */
-    default:
-        g_assert_not_reached();
-    }
+    do {
+        if (!(cpu->singlestep_enabled & SSTEP_NOIRQ) &&
+            hvf_inject_interrupts(cpu)) {
+            return EXCP_INTERRUPT;
+        }
+
+        bql_unlock();
+        r = hv_vcpu_run(cpu->accel->fd);
+        bql_lock();
+        switch (r) {
+        case HV_SUCCESS:
+            ret = hvf_handle_vmexit(cpu, cpu->accel->exit);
+            break;
+        case HV_ILLEGAL_GUEST_STATE:
+            trace_hvf_illegal_guest_state();
+            /* fall through */
+        default:

When doing vCPU reset I get here with r=0xfae94004, which is not
listed in <Hypervisor/hv_error.h>:

/*!
 * @enum       hv_return_t
 * @abstract   Hypervisor Framework return codes
 */
enum {
    HV_SUCCESS       = 0,
    HV_ERROR         = err_common_hypervisor | 0x01, /* (0xfae94001) */
    HV_BUSY          = err_common_hypervisor | 0x02, /* (0xfae94002) */
    HV_BAD_ARGUMENT  = err_common_hypervisor | 0x03, /* (0xfae94003) */
    HV_NO_RESOURCES  = err_common_hypervisor | 0x05, /* (0xfae94005) */
    HV_NO_DEVICE     = err_common_hypervisor | 0x06, /* (0xfae94006) */
    HV_DENIED        = err_common_hypervisor | 0x07, /* (0xfae94007) */
    HV_FAULT         = err_common_hypervisor | 0x08, /* (0xfae94008) */
    HV_UNSUPPORTED   = err_common_hypervisor | 0x0f  /* (0xfae9400f) */
};

Any clue what it means and how we should deal with it in case it is
not fatal?

Regards,

Phil.

+            g_assert_not_reached();
+        }
+    } while (ret == 0);
return ret;
  }


Reply via email to