[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/30] ppc/e500: Use start-powered-off CPUState property
From: |
David Gibson |
Subject: |
[PULL 18/30] ppc/e500: Use start-powered-off CPUState property |
Date: |
Fri, 4 Sep 2020 13:47:07 +1000 |
From: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Instead of setting CPUState::halted to 1 in ppce500_cpu_reset_sec(), use
the start-powered-off property which makes cpu_common_reset() initialize it
to 1 in common code.
Also change creation of CPU object from cpu_create() to object_new() and
qdev_realize_and_unref() because cpu_create() realizes the CPU and it's not
possible to set a property after the object is realized.
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-5-bauerman@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/ppc/e500.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index ab9884e315..ae39b9358e 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -704,9 +704,6 @@ static void ppce500_cpu_reset_sec(void *opaque)
cpu_reset(cs);
- /* Secondary CPU starts in halted state for now. Needs to change when
- implementing non-kernel boot. */
- cs->halted = 1;
cs->exception_index = EXCP_HLT;
}
@@ -865,7 +862,7 @@ void ppce500_init(MachineState *machine)
CPUState *cs;
qemu_irq *input;
- cpu = POWERPC_CPU(cpu_create(machine->cpu_type));
+ cpu = POWERPC_CPU(object_new(machine->cpu_type));
env = &cpu->env;
cs = CPU(cpu);
@@ -875,6 +872,14 @@ void ppce500_init(MachineState *machine)
exit(1);
}
+ /*
+ * Secondary CPU starts in halted state for now. Needs to change
+ * when implementing non-kernel boot.
+ */
+ object_property_set_bool(OBJECT(cs), "start-powered-off", i != 0,
+ &error_fatal);
+ qdev_realize_and_unref(DEVICE(cs), NULL, &error_fatal);
+
if (!firstenv) {
firstenv = env;
}
--
2.26.2
- [PULL 04/30] spapr/xive: Add a 'hv-prio' property to represent the KVM escalation priority, (continued)
- [PULL 04/30] spapr/xive: Add a 'hv-prio' property to represent the KVM escalation priority, David Gibson, 2020/09/03
- [PULL 02/30] ppc/pnv: Fix TypeInfo of PnvLpcController abstract class, David Gibson, 2020/09/03
- [PULL 06/30] spapr_vscsi: do not allow device hotplug, David Gibson, 2020/09/03
- [PULL 09/30] spapr/xive: Use kvmppc_xive_source_reset() in post_load, David Gibson, 2020/09/03
- [PULL 03/30] spapr: Remove unnecessary DRC type-checker macros, David Gibson, 2020/09/03
- [PULL 05/30] ppc/pnv: Add a HIOMAP erase command, David Gibson, 2020/09/03
- [PULL 07/30] spapr/xive: Use the xics flag to check for XIVE-only IRQ backends, David Gibson, 2020/09/03
- [PULL 08/30] spapr/xive: Modify kvm_cpu_is_enabled() interface, David Gibson, 2020/09/03
- [PULL 11/30] spapr/xive: Allocate vCPU IPIs from the vCPU contexts, David Gibson, 2020/09/03
- [PULL 10/30] spapr/xive: Allocate IPIs independently from the other sources, David Gibson, 2020/09/03
- [PULL 18/30] ppc/e500: Use start-powered-off CPUState property,
David Gibson <=
- [PULL 14/30] ppc/spapr_nvdimm: do not enable support with 'nvdimm=off', David Gibson, 2020/09/03
- [PULL 13/30] spapr, spapr_nvdimm: fold NVDIMM validation in the same place, David Gibson, 2020/09/03
- [PULL 12/30] ppc/spapr_nvdimm: use g_autofree in spapr_nvdimm_validate_opts(), David Gibson, 2020/09/03
- [PULL 17/30] ppc/spapr: Use start-powered-off CPUState property, David Gibson, 2020/09/03
- [PULL 15/30] target/arm: Move start-powered-off property to generic CPUState, David Gibson, 2020/09/03
- [PULL 19/30] mips/cps: Use start-powered-off CPUState property, David Gibson, 2020/09/03
- [PULL 16/30] target/arm: Move setting of CPU halted state to generic code, David Gibson, 2020/09/03
- [PULL 21/30] sparc/sun4m: Use start-powered-off CPUState property, David Gibson, 2020/09/03
- [PULL 20/30] sparc/sun4m: Don't set cs->halted = 0 in main_cpu_reset(), David Gibson, 2020/09/03
- [PULL 22/30] target/s390x: Use start-powered-off CPUState property, David Gibson, 2020/09/03