Re: [PATCH v2 4/9] ppc/e500: Use start-powered-off CPUState property
On Wed, Jul 22, 2020 at 12:50:11AM -0300, Thiago Jung Bauermann wrote: > 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. > > Signed-off-by: Thiago Jung Bauermann Reviewed-by: David Gibson > --- > hw/ppc/e500.c | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > NB: I was only able to test that this patch builds. I wasn't able to > run it. > > diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c > index ab9884e315..dda71bc05d 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; > } > > @@ -897,6 +894,13 @@ void ppce500_init(MachineState *machine) > } else { > /* Secondary CPUs */ > qemu_register_reset(ppce500_cpu_reset_sec, cpu); > + > +/* > + * 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", true, > + &error_abort); > } > } > > -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson signature.asc Description: PGP signature
Re: [PATCH v2 4/9] ppc/e500: Use start-powered-off CPUState property
On 7/22/20 5:50 AM, Thiago Jung Bauermann wrote: > 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. > > Signed-off-by: Thiago Jung Bauermann > --- > hw/ppc/e500.c | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > NB: I was only able to test that this patch builds. I wasn't able to > run it. > > diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c > index ab9884e315..dda71bc05d 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; > } > > @@ -897,6 +894,13 @@ void ppce500_init(MachineState *machine) > } else { > /* Secondary CPUs */ > qemu_register_reset(ppce500_cpu_reset_sec, cpu); > + > +/* > + * 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", true, > + &error_abort); > } > } Reviewed-by: Philippe Mathieu-Daudé
[PATCH v2 4/9] ppc/e500: Use start-powered-off CPUState property
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. Signed-off-by: Thiago Jung Bauermann --- hw/ppc/e500.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) NB: I was only able to test that this patch builds. I wasn't able to run it. diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index ab9884e315..dda71bc05d 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; } @@ -897,6 +894,13 @@ void ppce500_init(MachineState *machine) } else { /* Secondary CPUs */ qemu_register_reset(ppce500_cpu_reset_sec, cpu); + +/* + * 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", true, + &error_abort); } }