mbox series

[0/3] cpus: Avoid re-initializing fields cleared in cpu_common_reset_hold()

Message ID 20241230153929.87137-1-philmd@linaro.org
Headers show
Series cpus: Avoid re-initializing fields cleared in cpu_common_reset_hold() | expand

Message

Philippe Mathieu-Daudé Dec. 30, 2024, 3:39 p.m. UTC
Having this call tree:

  cpu_reset()
  -> device_cold_reset()
     -> DeviceClass::reset()
        -> target_cpu_reset()
           -> ResettablePhases::hold()
              -> CPUClass::phases::hold()
                 -> cpu_common_reset_hold()

If we call cpu_reset(), common fields will be reset in
cpu_common_reset_hold(), we don't need to manually do it.

Remove the pointless re-assignments on CPUState.

Based-on: <20241230152519.86291-1-philmd@linaro.org>

Philippe Mathieu-Daudé (3):
  accel/tcg: Remove pointless initialization of cflags_next_tb
  target/cpus: Remove pointless re-assignment of
    CPUState::exception_index
  target/cpus: Remove pointless re-assignment of CPUState::halted

 hw/core/cpu-common.c      | 1 -
 hw/misc/mips_cpc.c        | 1 -
 hw/ppc/e500.c             | 1 -
 target/arm/arm-powerctl.c | 2 --
 target/hppa/cpu.c         | 2 --
 target/loongarch/cpu.c    | 1 -
 target/openrisc/cpu.c     | 1 -
 7 files changed, 9 deletions(-)