[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 6/8] ppc: move cpu index setup to instance_init/fina
From: |
Greg Kurz |
Subject: |
[Qemu-devel] [PATCH 6/8] ppc: move cpu index setup to instance_init/finalize |
Date: |
Wed, 29 Jun 2016 22:51:23 +0200 |
User-agent: |
StGit/0.17.1-dirty |
This patch moves cpu_index initialization to instance init: it will
allow machine code to compute cpu_dt_id between cpu initialization and
cpu realization.
It also adds the related exit code to be called at instance finalize, for
symmetry.
This doesn't change behaviour when the cpu is setup with cpu_ppc_init(),
which handles initialization and realization sequentially. This is
currently the case for all configurations in both user and system mode.
Signed-off-by: Greg Kurz <address@hidden>
---
target-ppc/translate_init.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index d7860fd7f8ee..f7571f34d6ac 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -9540,9 +9540,9 @@ static void ppc_cpu_realizefn(DeviceState *dev, Error
**errp)
return;
}
#endif
- cpu_exec_init(cs, &local_err);
+ cpu_exec_realize(cs, &local_err);
if (local_err != NULL) {
error_propagate(errp, local_err);
return;
}
@@ -9772,9 +9772,9 @@ static void ppc_cpu_unrealizefn(DeviceState *dev, Error
**errp)
CPUPPCState *env = &cpu->env;
opc_handler_t **table;
int i, j;
- cpu_exec_exit(CPU(dev));
+ cpu_exec_unrealize(CPU(dev));
for (i = 0; i < PPC_CPU_OPCODES_LEN; i++) {
if (env->opcodes[i] == &invalid_handler) {
continue;
@@ -10336,8 +10336,15 @@ static void ppc_cpu_initfn(Object *obj)
if (tcg_enabled()) {
ppc_translate_init();
}
+
+ cpu_exec_init_cpu_index(cs, &error_abort);
+}
+
+static void ppc_cpu_finalizefn(Object *obj)
+{
+ cpu_exec_exit_cpu_index(CPU(obj));
}
static bool ppc_pvr_match_default(PowerPCCPUClass *pcc, uint32_t pvr)
{
@@ -10413,8 +10420,9 @@ static const TypeInfo ppc_cpu_type_info = {
.name = TYPE_POWERPC_CPU,
.parent = TYPE_CPU,
.instance_size = sizeof(PowerPCCPU),
.instance_init = ppc_cpu_initfn,
+ .instance_finalize = ppc_cpu_finalizefn,
.abstract = true,
.class_size = sizeof(PowerPCCPUClass),
.class_init = ppc_cpu_class_init,
};
- [Qemu-devel] [PATCH 0/8] ppc: compute cpu_dt_id in the machine code, Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 1/8] spapr: drop reference on child object during core realization, Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 2/8] spapr: do proper error propagation in spapr_cpu_core_realize_child(), Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 3/8] spapr: drop duplicate variable in spapr_core_release(), Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 4/8] exec: add missing conditional compilation, Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 5/8] exec: move cpu_index init and exit to their own function, Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 6/8] ppc: move cpu index setup to instance_init/finalize,
Greg Kurz <=
- [Qemu-devel] [PATCH 7/8] cpu: add initialization helper without realize, Greg Kurz, 2016/06/29
- [Qemu-devel] [PATCH 8/8] hw/ppc: move DT cpu id generation to machine code, Greg Kurz, 2016/06/29
- Re: [Qemu-devel] [Qemu-ppc] [PATCH 0/8] ppc: compute cpu_dt_id in the machine code, Greg Kurz, 2016/06/29
- Re: [Qemu-devel] [PATCH 0/8] ppc: compute cpu_dt_id in the machine code, David Gibson, 2016/06/30
- Re: [Qemu-devel] [PATCH 0/8] ppc: compute cpu_dt_id in the machine code, Igor Mammedov, 2016/06/30