hw/hppa: Reset vCPUs calling resettable_reset()
authorHelge Deller <deller@gmx.de>
Mon, 30 Dec 2024 09:53:25 +0000 (10:53 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 13 Jan 2025 16:16:04 +0000 (17:16 +0100)
Rather than manually (and incompletely) resetting vCPUs,
call resettable_reset() which will fully reset the vCPUs.
Remove redundant assignations.

Signed-off-by: Helge Deller <deller@gmx.de>
Co-developed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20241231190620.24442-4-philmd@linaro.org>

hw/hppa/machine.c
target/hppa/cpu.c

index 65259308e2ec720ee62fac3260480fb72b442e60..8230f43e41c24305cc1c9fb4ed8ec0e8abaacfb8 100644 (file)
@@ -655,12 +655,12 @@ static void hppa_machine_reset(MachineState *ms, ResetType type)
     for (i = 0; i < smp_cpus; i++) {
         CPUState *cs = CPU(cpu[i]);
 
+        /* reset CPU */
+        resettable_reset(OBJECT(cs), RESET_TYPE_COLD);
+
         cpu_set_pc(cs, firmware_entry);
         cpu[i]->env.psw = PSW_Q;
         cpu[i]->env.gr[5] = CPU_HPA + i * 0x1000;
-
-        cs->exception_index = -1;
-        cs->halted = 0;
     }
 
     /* already initialized by machine_hppa_init()? */
index d784bcdd6023c9b3ac2f4f81461c223b787d2fc8..41538d39d6208d3658c1874c8296c52ae9676e8e 100644 (file)
@@ -204,6 +204,7 @@ static void hppa_cpu_reset_hold(Object *obj, ResetType type)
         scc->parent_phases.hold(obj, type);
     }
     cs->exception_index = -1;
+    cs->halted = 0;
 
     memset(env, 0, offsetof(CPUHPPAState, end_reset_fields));