summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Le Goater2019-10-22 18:38:06 +0200
committerDavid Gibson2019-10-24 04:32:33 +0200
commit90f8db52bb7ea387ff45ac12bb73935b7fc27794 (patch)
tree35f10552ec911ad0d1873e8437526562e827842b
parentspapr: Don't request to unplug the same core twice (diff)
downloadqemu-90f8db52bb7ea387ff45ac12bb73935b7fc27794.tar.gz
qemu-90f8db52bb7ea387ff45ac12bb73935b7fc27794.tar.xz
qemu-90f8db52bb7ea387ff45ac12bb73935b7fc27794.zip
spapr: move CPU reset after presenter creation
This change prepares ground for future changes which will reset the interrupt presenter in the reset handler of the sPAPR and PowerNV cores. Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20191022163812.330-2-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--hw/ppc/spapr_cpu_core.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 3e4302c7d5..2b21285d20 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -234,13 +234,16 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
cpu_ppc_set_vhyp(cpu, PPC_VIRTUAL_HYPERVISOR(spapr));
kvmppc_set_papr(cpu);
- qemu_register_reset(spapr_cpu_reset, cpu);
- spapr_cpu_reset(cpu);
-
if (spapr_irq_cpu_intc_create(spapr, cpu, &local_err) < 0) {
- goto error_unregister;
+ goto error_intc_create;
}
+ /*
+ * FIXME: Hot-plugged CPUs are not reset. Do it at realize.
+ */
+ qemu_register_reset(spapr_cpu_reset, cpu);
+ spapr_cpu_reset(cpu);
+
if (!sc->pre_3_0_migration) {
vmstate_register(NULL, cs->cpu_index, &vmstate_spapr_cpu_state,
cpu->machine_data);
@@ -248,8 +251,7 @@ static void spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr,
return;
-error_unregister:
- qemu_unregister_reset(spapr_cpu_reset, cpu);
+error_intc_create:
cpu_remove_sync(CPU(cpu));
error:
error_propagate(errp, local_err);