OSDN Git Service

xics: setup cpu at realize time
authorGreg Kurz <groug@kaod.org>
Thu, 8 Jun 2017 13:42:59 +0000 (15:42 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 9 Jun 2017 02:15:57 +0000 (12:15 +1000)
commit9ed656631d73a7564dfe178ca8c48bf049098aaf
tree8b0121c4ade2d731e07e873ed64a6ea9ef80e4c2
parent100f738850639a108d6767316ce4dcc1d1ea4ae4
xics: setup cpu at realize time

Until recently, spapr used to allocate ICPState objects for the lifetime
of the machine. They would only be associated to vCPUs in xics_cpu_setup()
when plugging a CPU core.

Now that ICPState objects have the same lifecycle as vCPUs, it is
possible to associate them during realization.

This patch hence open-codes xics_cpu_setup() in icp_realize(). The vCPU
is passed as a property. Note that vCPU now needs to be realized first
for the IRQs to be allocated. It also needs to resetted before ICPState
realization in order to synchronize with KVM.

Since ICPState objects are freed when unrealized, xics_cpu_destroy() isn't
needed anymore and can be safely dropped.

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