From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLAdf-00016m-61 for qemu-devel@nongnu.org; Thu, 07 Jul 2016 10:50:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLAdb-0007Nu-1x for qemu-devel@nongnu.org; Thu, 07 Jul 2016 10:50:50 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLAda-0007Nn-Qa for qemu-devel@nongnu.org; Thu, 07 Jul 2016 10:50:46 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u67En65f027195 for ; Thu, 7 Jul 2016 10:50:46 -0400 Received: from e23smtp04.au.ibm.com (e23smtp04.au.ibm.com [202.81.31.146]) by mx0a-001b2d01.pphosted.com with ESMTP id 2415xky6dj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 07 Jul 2016 10:50:45 -0400 Received: from localhost by e23smtp04.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 Jul 2016 00:50:43 +1000 From: Bharata B Rao Date: Thu, 7 Jul 2016 20:20:23 +0530 In-Reply-To: <1467903025-13383-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1467903025-13383-1-git-send-email-bharata@linux.vnet.ibm.com> Message-Id: <1467903025-13383-4-git-send-email-bharata@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC PATCH v2 3/5] spapr: Set stable_cpu_id for threads of CPU cores List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, imammedo@redhat.com, groug@kaod.org, nikunj@linux.vnet.ibm.com, pbonzini@redhat.com, Bharata B Rao 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 --- 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