Conditonally set stable_cpu_id for CPU threads that are created as part of spapr CPU cores. The use of stable_cpu_id is enabled for pseries-2.7 onwards.
Signed-off-by: Bharata B Rao <bhar...@linux.vnet.ibm.com> --- hw/ppc/spapr_cpu_core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index b104778..0ec3513 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -293,8 +293,15 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error **errp) for (i = 0; i < cc->nr_threads; i++) { char id[32]; obj = sc->threads + i * size; + CPUState *cs; object_initialize(obj, size, typename); + cs = CPU(obj); + + /* Use core_id (which is actually cpu_dt_id) as stable CPU id */ + if (cs->has_stable_cpu_id) { + cs->stable_cpu_id = cc->core_id + i; + } snprintf(id, sizeof(id), "thread[%d]", i); object_property_add_child(OBJECT(sc), id, obj, &local_err); if (local_err) { -- 2.7.4