diff mbox series

[RFC,RESEND,39/42] target/arm: Implement TCGCPUOps::rebuild_tb_hflags()

Message ID 20250620172751.94231-40-philmd@linaro.org
State New
Headers show
Series accel/split/arm: Run EL2 using TCG and EL1/EL0 in hardware with HVF | expand

Commit Message

Philippe Mathieu-Daudé June 20, 2025, 5:27 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/arm/cpu.h         | 2 ++
 target/arm/cpu.c         | 1 +
 target/arm/tcg/cpu-v7m.c | 1 +
 target/arm/tcg/hflags.c  | 5 +++++
 4 files changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index c31f69912b8..b703ec7edc9 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -3160,9 +3160,11 @@  void arm_register_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, void
 
 /**
  * arm_rebuild_hflags:
+ * arm_cpu_rebuild_hflags:
  * Rebuild the cached TBFLAGS for arbitrary changed processor state.
  */
 void arm_rebuild_hflags(CPUARMState *env);
+void arm_cpu_rebuild_hflags(CPUState *cpu);
 
 /**
  * aa32_vfp_dreg:
diff --git a/target/arm/cpu.c b/target/arm/cpu.c
index 1a19e5cfb45..32a2e6c75e1 100644
--- a/target/arm/cpu.c
+++ b/target/arm/cpu.c
@@ -2743,6 +2743,7 @@  static const TCGCPUOps arm_tcg_ops = {
 
     .initialize = arm_translate_init,
     .translate_code = arm_translate_code,
+    .rebuild_tb_hflags = arm_cpu_rebuild_hflags,
     .get_tb_cpu_state = arm_get_tb_cpu_state,
     .synchronize_from_tb = arm_cpu_synchronize_from_tb,
     .debug_excp_handler = arm_debug_excp_handler,
diff --git a/target/arm/tcg/cpu-v7m.c b/target/arm/tcg/cpu-v7m.c
index 8e1a083b911..fa17029c65f 100644
--- a/target/arm/tcg/cpu-v7m.c
+++ b/target/arm/tcg/cpu-v7m.c
@@ -238,6 +238,7 @@  static const TCGCPUOps arm_v7m_tcg_ops = {
 
     .initialize = arm_translate_init,
     .translate_code = arm_translate_code,
+    .rebuild_tb_hflags = arm_cpu_rebuild_hflags,
     .get_tb_cpu_state = arm_get_tb_cpu_state,
     .synchronize_from_tb = arm_cpu_synchronize_from_tb,
     .debug_excp_handler = arm_debug_excp_handler,
diff --git a/target/arm/tcg/hflags.c b/target/arm/tcg/hflags.c
index 1ccec63bbd4..ea1174c661c 100644
--- a/target/arm/tcg/hflags.c
+++ b/target/arm/tcg/hflags.c
@@ -453,6 +453,11 @@  void arm_rebuild_hflags(CPUARMState *env)
     env->hflags = rebuild_hflags_internal(env);
 }
 
+void arm_cpu_rebuild_hflags(CPUState *cpu)
+{
+    arm_rebuild_hflags(cpu_env(cpu));
+}
+
 /*
  * If we have triggered a EL state change we can't rely on the
  * translator having passed it to us, we need to recompute.