[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/12] accel/tcg: Reset TCG specific fields in tcg_cpu_reset_h
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 11/12] accel/tcg: Reset TCG specific fields in tcg_cpu_reset_hold() |
Date: |
Sun, 28 Apr 2024 23:49:14 +0200 |
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>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20240427155714.53669-14-philmd@linaro.org>
---
accel/tcg/tcg-accel-ops.c | 3 +++
hw/core/cpu-common.c | 2 --
2 files changed, 3 insertions(+), 2 deletions(-)
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;
--
2.41.0
- [PATCH v2 06/12] exec/cpu: Remove duplicated PAGE_PASSTHROUGH definition, (continued)
- [PATCH v2 06/12] exec/cpu: Remove duplicated PAGE_PASSTHROUGH definition, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH v2 04/12] exec/cpu: Indent TARGET_PAGE_foo definitions, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH v2 07/12] exec/cpu: Extract page-protection definitions to page-protection.h, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH v2 08/12] accel/tcg: Use cpu_loop_exit_requested() in cpu_loop_exec_tb(), Philippe Mathieu-Daudé, 2024/04/28
- [PATCH v2 10/12] accel/tcg: Remove pointless initialization of cflags_next_tb, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH v2 09/12] accel/tcg: Restrict cpu_loop_exit_requested() to TCG, Philippe Mathieu-Daudé, 2024/04/28
- [PATCH v2 11/12] accel/tcg: Reset TCG specific fields in tcg_cpu_reset_hold(),
Philippe Mathieu-Daudé <=
- [PATCH v2 12/12] accel/tcg: Access tcg_cflags with getter / setter, Philippe Mathieu-Daudé, 2024/04/28
- Re: [PATCH v2 00/12] exec: Rework around CPUState user fields, Philippe Mathieu-Daudé, 2024/04/29