]> git.proxmox.com Git - mirror_qemu.git/commit
spapr: Ensure thread0 of CPU core is always realized first
authorBharata B Rao <bharata@linux.vnet.ibm.com>
Fri, 1 Jul 2016 05:14:39 +0000 (10:44 +0530)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 5 Jul 2016 00:43:02 +0000 (10:43 +1000)
commit7093645a843e5da1a750bc451dd8c9107d595c61
tree27768d0066e622451718b5b7e09821f38a0513f8
parent158c87e5de4f34840bf8115789f09806e7e14b94
spapr: Ensure thread0 of CPU core is always realized first

During CPU core realization, we create all the thread objects and parent
them to the core object in a loop. However, the realization of thread
objects is done separately by walking the threads of a core using
object_child_foreach(). With this, there is no guarantee on the order
in which the child thread objects get realized. Since CPU device tree
properties are currently derived from the CPU thread object, we assume
thread0 of the core to be the representative thread of the core when
creating device tree properties for the core. If thread0 is not the
first thread that gets realized, then we would end up having an
incorrect dt_id for the core and this causes hotplug failures from
the guest.

Fix this by realizing each thread object by walking the core's thread
object list thereby ensuring that thread0 and other threads are always
realized in the correct order.

Future TODO: CPU DT nodes are per-core properties and we should
ideally base the creation of CPU DT nodes on core objects rather than
the thread objects.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_cpu_core.c