sparc/sun4m: Use start-powered-off CPUState property
commit24f675cd3b1406f3af9f9b811bb6946d0e2e6ecf
authorThiago Jung Bauermann <bauerman@linux.ibm.com>
Wed, 26 Aug 2020 05:55:34 +0000 (26 02:55 -0300)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 8 Sep 2020 00:08:43 +0000 (8 10:08 +1000)
tree5e9a8e9d27f98c3db006731bf45011450ad5e35d
parent3d0c102092bc6096c278784484605096aa4f2384
sparc/sun4m: Use start-powered-off CPUState property

Instead of setting CPUState::halted to 1 in secondary_cpu_reset(), use the
start-powered-off property which makes cpu_common_reset() initialize it
to 1 in common code.

Now secondary_cpu_reset() becomes equivalent to main_cpu_reset() so rename
the function to sun4m_cpu_reset().

Also remove setting of cs->halted from cpu_devinit(), which seems out of
place when compared to similar code in other architectures (e.g.,
ppce500_init() in hw/ppc/e500.c).

Finally, 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.

Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-8-bauerman@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/sparc/sun4m.c