From patchwork Fri Feb 10 06:04:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 726421 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vKPZY5QvTz9s2P for ; Fri, 10 Feb 2017 17:05:57 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vKPZY4gvvzDqGn for ; Fri, 10 Feb 2017 17:05:57 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vKPZL6rn3zDq8g for ; Fri, 10 Feb 2017 17:05:46 +1100 (AEDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1A5xPka083204 for ; Fri, 10 Feb 2017 01:05:45 -0500 Received: from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141]) by mx0a-001b2d01.pphosted.com with ESMTP id 28gr9mmwet-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 10 Feb 2017 01:05:44 -0500 Received: from localhost by e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 Feb 2017 16:05:42 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 10 Feb 2017 16:05:41 +1000 Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id C3D492CE8046 for ; Fri, 10 Feb 2017 17:05:40 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1A65Wgq37814372 for ; Fri, 10 Feb 2017 17:05:40 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1A658Fb013475 for ; Fri, 10 Feb 2017 17:05:08 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1A658BH012682; Fri, 10 Feb 2017 17:05:08 +1100 Received: from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) by ozlabs.au.ibm.com (Postfix) with ESMTP id CF287A01AB; Fri, 10 Feb 2017 17:04:43 +1100 (AEDT) Received: from gwshan.ozlabs.ibm.com (shangw.ozlabs.ibm.com [10.61.2.199]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id BBC25E3D40; Fri, 10 Feb 2017 17:04:43 +1100 (AEDT) Received: by gwshan.ozlabs.ibm.com (Postfix, from userid 1000) id A80E7AC1467; Fri, 10 Feb 2017 17:04:43 +1100 (AEDT) From: Gavin Shan To: skiboot@lists.ozlabs.org Date: Fri, 10 Feb 2017 17:04:43 +1100 X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021006-0048-0000-0000-00000203F7A8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021006-0049-0000-0000-0000478223DC Message-Id: <1486706683-16657-1-git-send-email-gwshan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-10_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702100061 Subject: [Skiboot] [PATCH RFC RESEND] core/affinity: Fix NUMA node associativity on P8 and P8NVL X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" We have variable distances from Node-A to Node-B on different machines as below: Machine CPU A <-> A A <-> B ------------------------------------------ Tuleta POWER8E 10 20 Firestone POWER8 10 40 Garrison POWER8NVL 10 40 This fixes the distance between Node-A and Node-B to 20 for all POWER8 platforms, which is the value defined by Linux kernel. After the patch is applied, we have: Machine CPU A <-> A A <-> B ------------------------------------------ Tuleta POWER8E 10 20 Firestone POWER8 10 20 Garrison POWER8NVL 10 20 Signed-off-by: Gavin Shan --- core/affinity.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/affinity.c b/core/affinity.c index 9f489d3..64c1fda 100644 --- a/core/affinity.c +++ b/core/affinity.c @@ -67,6 +67,7 @@ static uint32_t get_chip_node_id(struct proc_chip *chip) void add_associativity_ref_point(void) { + unsigned long pvr = mfspr(SPR_PVR); int ref2 = 0x4; /* @@ -82,9 +83,12 @@ void add_associativity_ref_point(void) * as a second level of NUMA. * * If there is a way to obtain this information from the FSP - * that would be ideal, but for now hardwire our POWER8E setting. + * that would be ideal, but for now hardwire our POWER8E, POWER8 + * and POWER8NVL setting. */ - if (PVR_TYPE(mfspr(SPR_PVR)) == PVR_TYPE_P8E) + if (PVR_TYPE(pvr) == PVR_TYPE_P8E || + PVR_TYPE(pvr) == PVR_TYPE_P8 || + PVR_TYPE(pvr) == PVR_TYPE_P8NVL) ref2 = 0x3; dt_add_property_cells(opal_node, "ibm,associativity-reference-points",