Received: by 10.223.164.202 with SMTP id h10csp180245wrb; Thu, 9 Nov 2017 04:48:43 -0800 (PST) X-Google-Smtp-Source: ABhQp+Rsk11kSefVodxKn/KMLBmBIhvgzKiuibMIILxsxbhiLRibDPtZtw7zXkjl8hiMQVlnjnrB X-Received: by 10.84.139.129 with SMTP id 1mr366153plr.167.1510231723600; Thu, 09 Nov 2017 04:48:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510231723; cv=none; d=google.com; s=arc-20160816; b=mg2UY6hPunx96DRzZ3USRL/sAvGf5whHCwKVBWq+1QD6JzTu3i4tHZoAgiIJ0EKBtC CeXR3izFQEpDPZVsSUQRxbhyDiGTgaoz5V9b4wU3JZTo3FM4oZ9LQWfmpYTUl15eH9PE XATPZhth88JZ0B54VIyp70bMlRvtcoY1kxDFZwKRiKpDyI/G94lIxzPl42hBz6yPG6nX Yl+pKmRI8WqNcJ0meUDK5T/mZWNYa4mVYKPi9mB21eWpv2OWjEJisRrI1FLtHDQA9B7K LYTpWC58ZkOqnKQ+aYowOf04lw15Mv6WT5blV4jVYzxQBHyEovZ7H652Y8aTgIJgQ5ZA vnMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:arc-authentication-results; bh=5xckuNqBaMdA31QLRHqzwo1bjN/f94ZKnCAf8xlXzA8=; b=vpSViPA4su2xak8Y4cD+n7Bdd79nvKiuMvbX57RkK5vpijF0A3wHAp+KqabXsJBXpi U85AFj8CksM9RQ7ZPsSw9v6/dWo/DX3avIzc8zr5KAmtujelDCSRmgVjwZWlR+2Rw/j/ OEz6g1MbDqJ0WMCWHZqr3AoRNiAd6pZ/hPIJMEGp+BH8wtL6+uBLKUPT1yFydpsjG2Ct wLcsJZjK9ftG12pcZp7A76uFpjrmt4ptlTeoGaxomVD4E794+AmSVK4iN2WhJo8fI/7p YQ5GHrac88ZLxHSKAPeGOzW9O2nHCfntx3eszDR2mQypqLrOSb2+4Ph+RAn9GbZyS/tk 0V3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si3635302pfi.390.2017.11.09.04.48.32; Thu, 09 Nov 2017 04:48:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754524AbdKIMrd (ORCPT + 80 others); Thu, 9 Nov 2017 07:47:33 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36188 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753014AbdKIMrc (ORCPT ); Thu, 9 Nov 2017 07:47:32 -0500 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA9Ci33r132321 for ; Thu, 9 Nov 2017 07:47:31 -0500 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0b-001b2d01.pphosted.com with ESMTP id 2e4kw1jn3y-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 09 Nov 2017 07:47:31 -0500 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 Nov 2017 05:47:30 -0700 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 9 Nov 2017 05:47:27 -0700 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vA9ClRol65208412; Thu, 9 Nov 2017 05:47:27 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 648FE78043; Thu, 9 Nov 2017 05:47:27 -0700 (MST) Received: from [9.195.36.106] (unknown [9.195.36.106]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP id D41C678037; Thu, 9 Nov 2017 05:47:25 -0700 (MST) Subject: Re: [PATCH v3] powerpc/kernel/sysfs: Export ldbar spr to sysfs To: mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, maddy@linux.vnet.ibm.com References: <1510229604-5839-1-git-send-email-anju@linux.vnet.ibm.com> From: Anju T Sudhakar Date: Thu, 9 Nov 2017 18:17:24 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1510229604-5839-1-git-send-email-anju@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 17110912-0028-0000-0000-0000089FC0C6 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008037; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00943378; UDB=6.00475964; IPR=6.00723661; BA=6.00005681; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017933; XFM=3.00000015; UTC=2017-11-09 12:47:28 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110912-0029-0000-0000-00003843EF96 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-09_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711090179 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Kindly ignore this patch, I send a wrong version. Will send out the right one. Thanks, Anju On Thursday 09 November 2017 05:43 PM, Anju T Sudhakar wrote: > Add ldbar spr to sysfs. The spr holds thread level In-Memory Collection (IMC) > counter configuration data. Exposing this will help to understand the current > configuration of thread-level counters in the system. > Primarily, Bit 0 of ldbar says whether the counters are enabled or not. > And bit 1 indicates the mode (if 0-Accumulation Mode/if 1-Trace Mode). > > Signed-off-by: Anju T Sudhakar > --- > arch/powerpc/kernel/sysfs.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c > index 4437c70..f8caee0 100644 > --- a/arch/powerpc/kernel/sysfs.c > +++ b/arch/powerpc/kernel/sysfs.c > @@ -485,6 +485,7 @@ SYSFS_PMCSETUP(mmcra, SPRN_MMCRA); > SYSFS_SPRSETUP(purr, SPRN_PURR); > SYSFS_SPRSETUP(spurr, SPRN_SPURR); > SYSFS_SPRSETUP(pir, SPRN_PIR); > +SYSFS_SPRSETUP(ldbar, SPRN_LDBAR); > > /* > Lets only enable read for phyp resources and > @@ -492,6 +493,7 @@ SYSFS_SPRSETUP(pir, SPRN_PIR); > Lets be conservative and default to pseries. > */ > static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra); > +static DEVICE_ATTR(ldbar, 0400, show_ldbar, store_ldbar); > static DEVICE_ATTR(spurr, 0400, show_spurr, NULL); > static DEVICE_ATTR(purr, 0400, show_purr, store_purr); > static DEVICE_ATTR(pir, 0400, show_pir, NULL); > @@ -757,6 +759,9 @@ static int register_cpu_online(unsigned int cpu) > device_create_file(s, &pmc_attrs[i]); > > #ifdef CONFIG_PPC64 > + if (cpu_has_feature(CPU_FTR_ARCH_300)) > + device_create_file(s, &dev_attr_ldbar); > + > if (cpu_has_feature(CPU_FTR_MMCRA)) > device_create_file(s, &dev_attr_mmcra); > > @@ -842,6 +847,9 @@ static int unregister_cpu_online(unsigned int cpu) > device_remove_file(s, &pmc_attrs[i]); > > #ifdef CONFIG_PPC64 > + if (cpu_has_feature(CPU_FTR_ARCH_300)) > + device_remove_file(s, &dev_attr_ldbar); > + > if (cpu_has_feature(CPU_FTR_MMCRA)) > device_remove_file(s, &dev_attr_mmcra); > From 1583590581263009515@xxx Thu Nov 09 12:14:25 +0000 2017 X-GM-THRID: 1583590581263009515 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread