pseries: Always use core objects for CPU construction
commit0c86d0fd92aaecc2e69041dc747299dbc0be4bb9
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 8 Nov 2016 05:33:32 +0000 (8 16:33 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 30 Jan 2017 23:10:13 +0000 (31 10:10 +1100)
tree9e6b4d84bb4e074bb3cfeefcdcddf0ae670db942
parent60caf2216bf03d0f32ef11cb670279d0dea6d593
pseries: Always use core objects for CPU construction

Currently the pseries machine has two paths for constructing CPUs.  On
newer machine type versions, which support cpu hotplug, it constructs
cpu core objects, which in turn construct CPU threads.  For older machine
versions it individually constructs the CPU threads.

This division is going to make some future changes to the cpu construction
harder, so this patch unifies them.  Now cpu core objects are always
created.  This requires some updates to allow core objects to be created
without a full complement of threads (since older versions allowed a
number of cpus not a multiple of the threads-per-core).  Likewise it needs
some changes to the cpu core hot/cold plug path so as not to choke on the
old machine types without hotplug support.

For good measure, we move the cpu construction to its own subfunction,
spapr_init_cpus().

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
hw/ppc/spapr.c
hw/ppc/spapr_cpu_core.c
include/hw/ppc/spapr.h