diff mbox series

[2/3] target/cpus: Remove pointless re-assignment of CPUState::exception_index

Message ID 20241230153929.87137-3-philmd@linaro.org (mailing list archive)
State New
Headers show
Series cpus: Avoid re-initializing fields cleared in cpu_common_reset_hold() | expand

Commit Message

Philippe Mathieu-Daudé Dec. 30, 2024, 3:39 p.m. UTC
The CPUState::exception_index field is always re-initialized
by the parent CPU ResetHold() handler in cpu_common_reset_hold(),
no need to have targets manually initializing it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/hppa/cpu.c      | 1 -
 target/loongarch/cpu.c | 1 -
 target/openrisc/cpu.c  | 1 -
 3 files changed, 3 deletions(-)
diff mbox series

Patch

diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index 6e5434a8e99..9b355bfe902 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -203,7 +203,6 @@  static void hppa_cpu_reset_hold(Object *obj, ResetType type)
     if (scc->parent_phases.hold) {
         scc->parent_phases.hold(obj, type);
     }
-    cs->exception_index = -1;
     cs->halted = 0;
     cpu_set_pc(cs, 0xf0000004);
 
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index d611a604704..fd062d2e3e1 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -584,7 +584,6 @@  static void loongarch_cpu_reset_hold(Object *obj, ResetType type)
 #ifdef CONFIG_TCG
     restore_fp_status(env);
 #endif
-    cs->exception_index = -1;
 }
 
 static void loongarch_cpu_disas_set_info(CPUState *s, disassemble_info *info)
diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c
index b7bab0d7abf..84aa9448256 100644
--- a/target/openrisc/cpu.c
+++ b/target/openrisc/cpu.c
@@ -101,7 +101,6 @@  static void openrisc_cpu_reset_hold(Object *obj, ResetType type)
     cpu->env.pc = 0x100;
     cpu->env.sr = SR_FO | SR_SM;
     cpu->env.lock_addr = -1;
-    cs->exception_index = -1;
     cpu_set_fpcsr(&cpu->env, 0);
 
     set_float_detect_tininess(float_tininess_before_rounding,