spapr: Introduce sPAPRCPUCoreClass
commit7ebaf7955603cc50988e0eafd5e6074320fefc70
authorBharata B Rao <bharata@linux.vnet.ibm.com>
Mon, 12 Sep 2016 07:57:20 +0000 (12 13:27 +0530)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 23 Sep 2016 02:39:06 +0000 (23 12:39 +1000)
treef732a079ae853101538a72a3ec27dade4602b714
parentfec5c62a6434bc306906972e276c5a6f2cafdd9a
spapr: Introduce sPAPRCPUCoreClass

Each spapr cpu core type defines an instance_init routine which just
populates the CPU class name. This can be done in the class_init
commonly for all core types which simplifies the registration.
This is inspired by how PowerNV core types are registered.

Certain types of spapr cpu cores ('host' and generic type based on host
CPU) are initialized in target-ppc/kvm.c. To convert these type
registrations to use class_init, we need to expose
spapr_cpu_core_class_init() outside of spapr_cpu_core.c.

Commit d11b268e1765 added a generic sPAPR CPU core family
type to support cases like POWER8 CPU type on POWER8E host CPU.
Switching to class_init would fix such scenarios to use the right
CPU thread type instead of defaulting to host-powerpc64-cpu.

In an unrelated cleanup, fix a typo in .get_hotplug_handler routine.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c
hw/ppc/spapr_cpu_core.c
include/hw/ppc/spapr_cpu_core.h
target-ppc/kvm.c