diff mbox series

[RFC,RESEND,40/42] accel/split: Call TCGCPUOps::rebuild_tb_hflags()

Message ID 20250620172751.94231-41-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
Call TCG rebuild_tb_hflags() when transitioning from
hardware accelerator to TCG.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/split/split-accel-ops.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Richard Henderson June 22, 2025, 3:34 a.m. UTC | #1
On 6/20/25 10:27, Philippe Mathieu-Daudé wrote:
> Call TCG rebuild_tb_hflags() when transitioning from
> hardware accelerator to TCG.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   accel/split/split-accel-ops.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/accel/split/split-accel-ops.c b/accel/split/split-accel-ops.c
> index 615faf1d96b..4b058034252 100644
> --- a/accel/split/split-accel-ops.c
> +++ b/accel/split/split-accel-ops.c
> @@ -40,6 +40,8 @@ static void *split_cpu_thread_routine(void *arg)
>       assert(swc->allowed);
>       assert(hwc->allowed);
>   
> +    assert(swops->rebuild_tcg_tb_flags);
> +
>       rcu_register_thread();
>       sw_force_rcu = mttcg_vcpu_register(cpu);
>   
> @@ -69,6 +71,7 @@ static void *split_cpu_thread_routine(void *arg)
>                   r = hwops->exec_vcpu_thread(cpu);
>                   trace_accel_split_exec_vcpu_thread_hw(r);
>               } else {
> +                swops->rebuild_tcg_tb_flags(cpu);
>                   r = swops->exec_vcpu_thread(cpu)

You should not need to do this before every exec, only on transitions.


r~
diff mbox series

Patch

diff --git a/accel/split/split-accel-ops.c b/accel/split/split-accel-ops.c
index 615faf1d96b..4b058034252 100644
--- a/accel/split/split-accel-ops.c
+++ b/accel/split/split-accel-ops.c
@@ -40,6 +40,8 @@  static void *split_cpu_thread_routine(void *arg)
     assert(swc->allowed);
     assert(hwc->allowed);
 
+    assert(swops->rebuild_tcg_tb_flags);
+
     rcu_register_thread();
     sw_force_rcu = mttcg_vcpu_register(cpu);
 
@@ -69,6 +71,7 @@  static void *split_cpu_thread_routine(void *arg)
                 r = hwops->exec_vcpu_thread(cpu);
                 trace_accel_split_exec_vcpu_thread_hw(r);
             } else {
+                swops->rebuild_tcg_tb_flags(cpu);
                 r = swops->exec_vcpu_thread(cpu);
                 trace_accel_split_exec_vcpu_thread_sw(r);
             }