On 1/4/23 13:58, Fabiano Rosas wrote:
@@ -25,6 +25,7 @@
  #include "qemu/config-file.h"
  #include "qemu/option.h"
  #include "qemu/units.h"
+#include "sysemu/tcg.h"
/* Kernel boot protocol is specified in the kernel docs
   * Documentation/arm/Booting and Documentation/arm64/booting.txt
@@ -827,7 +828,9 @@ static void do_cpu_reset(void *opaque)
                  info->secondary_cpu_reset_hook(cpu, info);
              }
          }
-        arm_rebuild_hflags(env);
+        if (tcg_enabled()) {
+            arm_rebuild_hflags(env);
+        }

We certainly are adding lots of wrapping for this function.
Should we handle it just once in a header instead?

--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -241,7 +241,7 @@ int sme_exception_el(CPUARMState *env, int el)
  }
/* This corresponds to the ARM pseudocode function IsFullA64Enabled(). */
-static bool sme_fa64(CPUARMState *env, int el)
+bool sme_fa64(CPUARMState *env, int el)

This function should be moved as well, as it's only used by hflags.

@@ -25,3 +26,12 @@ void arm_reset_sve_state(CPUARMState *env)
  {
      g_assert_not_reached();
  }
+
+void arm_rebuild_hflags(CPUARMState *env)
+{
+    g_assert_not_reached();
+}
+
+void assert_hflags_rebuild_correctly(CPUARMState *env)
+{
+}

Do we really need these? I would expect the tcg_enabled() test to dead-code-eliminate the calls...



r~

Reply via email to