spapr: disintricate core-id from DT semantics
commit12bf2d33fe520f9cfd09f7bf9d46ae3202c3cb49
authorGreg Kurz <groug@kaod.org>
Fri, 22 Jul 2016 11:10:36 +0000 (22 13:10 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 25 Jul 2016 05:43:41 +0000 (25 15:43 +1000)
tree11d5a8c78175d70a99ec9ca3a7ce54650179024d
parent2fff4bad40abe5781d21c5e134161a1bd13c43cd
spapr: disintricate core-id from DT semantics

The goal of this patch is to have a stable core-id which does not depend
on any DT related semantics, which involve non-obvious computations on
modern PowerPC server cpus.

With this patch, the DT core id is computed on-demand as:

       (core-id / smp_threads) * smt

where smt is the number of threads per core in the host.

This formula should be consolidated in a helper since it is needed in
several places.

Other uses for core-id includes: compute a stable cpu_index (which
allows random order hotplug/unplug without breaking migration) and
NUMA.

Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c
hw/ppc/spapr_cpu_core.c