diff mbox series

[13/14] accel/tcg: Reset TCG specific fields in tcg_cpu_reset_hold()

Message ID 20240427155714.53669-14-philmd@linaro.org
State Superseded
Headers show
Series exec: Rework around CPUState user fields | expand

Commit Message

Philippe Mathieu-Daudé April 27, 2024, 3:57 p.m. UTC
Rather than resetting TCG specific fields in the common
cpu_common_reset_hold(), do it in tcg_cpu_reset_hold().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 accel/tcg/tcg-accel-ops.c | 3 +++
 hw/core/cpu-common.c      | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Richard Henderson April 28, 2024, 6:46 p.m. UTC | #1
On 4/27/24 08:57, Philippe Mathieu-Daudé wrote:
> Rather than resetting TCG specific fields in the common
> cpu_common_reset_hold(), do it in tcg_cpu_reset_hold().
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   accel/tcg/tcg-accel-ops.c | 3 +++
>   hw/core/cpu-common.c      | 2 --
>   2 files changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c
index 2c7b0cc09e..be99105ac5 100644
--- a/accel/tcg/tcg-accel-ops.c
+++ b/accel/tcg/tcg-accel-ops.c
@@ -85,6 +85,9 @@  static void tcg_cpu_reset_hold(CPUState *cpu)
     tcg_flush_jmp_cache(cpu);
 
     tlb_flush(cpu);
+
+    qatomic_set(&cpu->neg.icount_decr.u32, 0);
+    cpu->neg.can_do_io = true;
 }
 
 /* mask must never be zero, except for A20 change call */
diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c
index c4175cc4b9..9b3efba82f 100644
--- a/hw/core/cpu-common.c
+++ b/hw/core/cpu-common.c
@@ -127,8 +127,6 @@  static void cpu_common_reset_hold(Object *obj, ResetType type)
     cpu->halted = cpu->start_powered_off;
     cpu->mem_io_pc = 0;
     cpu->icount_extra = 0;
-    qatomic_set(&cpu->neg.icount_decr.u32, 0);
-    cpu->neg.can_do_io = true;
     cpu->exception_index = -1;
     cpu->crash_occurred = false;
     cpu->cflags_next_tb = -1;