spapr: allocate the ICPState object from under sPAPRCPUCore
commit5bc8d26de20ca6befe6390f381cb98120237e4be
authorCédric Le Goater <clg@kaod.org>
Mon, 3 Apr 2017 07:45:58 +0000 (3 09:45 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 26 Apr 2017 02:00:42 +0000 (26 12:00 +1000)
tree1930ab4d88ee04c8639c4686725a7bde0d20e0a8
parent06747ba6d424e213efcb58578aadd56eb882877a
spapr: allocate the ICPState object from under sPAPRCPUCore

Today, all the ICPs are created before the CPUs, stored in an array
under the sPAPR machine and linked to the CPU when the core threads
are realized. This modeling brings some complexity when a lookup in
the array is required and it can be simplified by allocating the ICPs
when the CPUs are.

This is the purpose of this proposal which introduces a new 'icp_type'
field under the machine and creates the ICP objects of the right type
(KVM or not) before the PowerPCCPU object are.

This change allows more cleanups : the removal of the icps array under
the sPAPR machine and the removal of the xics_get_cpu_index_by_dt_id()
helper.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/intc/xics.c
hw/ppc/spapr.c
hw/ppc/spapr_cpu_core.c
include/hw/ppc/spapr.h
include/hw/ppc/xics.h