spapr: Ensure CPU cores are added contiguously and removed in LIFO order
commit5cbc64de25973e9129c5a7897734a06ac64b9aff
authorBharata B Rao <bharata@linux.vnet.ibm.com>
Wed, 13 Jul 2016 06:50:20 +0000 (13 12:20 +0530)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 18 Jul 2016 00:40:27 +0000 (18 10:40 +1000)
tree2bac96cf0e8ce6e2f576e1bf184c6fdaec15ff24
parent21bb3093e6accd2d7d60531a472a34e40911acd9
spapr: Ensure CPU cores are added contiguously and removed in LIFO order

If CPU core addition or removal is allowed in random order leading to
holes in the core id range (and hence in the cpu_index range), migration
can fail as migration with holes in cpu_index range isn't yet handled
correctly.

Prevent this situation by enforcing the addition in contiguous order
and removal in LIFO order so that we never end up with holes in
cpu_index range.

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