[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 2/5] hw/hppa: Reset vCPUs calling resettable_reset()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 2/5] hw/hppa: Reset vCPUs calling resettable_reset() |
Date: |
Mon, 30 Dec 2024 16:25:16 +0100 |
From: Helge Deller <deller@gmx.de>
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>
---
hw/hppa/machine.c | 6 +++---
target/hppa/cpu.c | 1 +
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 65259308e2e..8230f43e41c 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -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()? */
diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index d784bcdd602..41538d39d62 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -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));
--
2.47.1
- [PATCH v3 0/5] hppa CPU reset and speedup, Philippe Mathieu-Daudé, 2024/12/30
- [PATCH v3 1/5] target/hppa: Convert hppa_cpu_init() to ResetHold handler, Philippe Mathieu-Daudé, 2024/12/30
- [PATCH v3 2/5] hw/hppa: Reset vCPUs calling resettable_reset(),
Philippe Mathieu-Daudé <=
- [PATCH v3 3/5] target/hppa: Only set PSW 'M' bit on reset, Philippe Mathieu-Daudé, 2024/12/30
- [PATCH v3 4/5] target/hppa: Set PC on vCPU reset, Philippe Mathieu-Daudé, 2024/12/30
- [PATCH v3 5/5] target/hppa: Speed up hppa_is_pa20(), Philippe Mathieu-Daudé, 2024/12/30
- Re: [PATCH v3 0/5] hppa CPU reset and speedup, Helge Deller, 2024/12/30
- Re: [PATCH v3 0/5] hppa CPU reset and speedup, Philippe Mathieu-Daudé, 2024/12/30