Received: by 10.223.164.202 with SMTP id h10csp146872wrb; Thu, 9 Nov 2017 04:14:25 -0800 (PST) X-Google-Smtp-Source: ABhQp+QtEUJ3BUqMcsYtnVnnZZY0KVRKeZnF4DGxWEAEImGSaBxq/1eicotQcRE5KdMeVJy0k3ZN X-Received: by 10.98.31.14 with SMTP id f14mr271172pff.235.1510229665028; Thu, 09 Nov 2017 04:14:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510229664; cv=none; d=google.com; s=arc-20160816; b=01R+R14jPqsA7X1IZMo9jXCCUnwyx1TnLeWOHvYNixs2Bcjl/6Ljrk30TXJocEgr22 o9yj+NmOfDMU+xiWkZhNTa2cdL4dCAXOVE0v1X4Gzwt/H6W3wDLhrYdf/U+NlwXFzHKK PJ5gCFFGueYl1h+Q3klvUYuE+0TWSin1yCvbDodDZZg3nT9suKFO81Ru+FFA1mp5JRLw s2hWpGGU8InCoMyeasKuMTenxor0PbyP7Aqhblx2/dWoG/ivSzHMRBOjGCnTiWrREtM/ UBLeWGMpBej2e+YnFZocnCP5oBq3bqucVtqmLX3lDVclWyMQ39FKEUJd4aenWhtpXbms 1VlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=vPnERLv1pXt7J/DCAmk9tCdYUt2PqaWUMyxEL2jdFLc=; b=kz45cpJAw29D9pxSBIcldhSrh237UzXQBxeFANPfxZhDyrAw5jDNEXZWx+FRrwXkep SVAfgk2KnAwYvaUs8B7xXbVE8TC5CpQseMNsCzd2E52j85ma6R51JjXFO8JLAEQ2a9kC A7jN2XWVhhvZczig450Hbw80VoinjvnV2AuO+G9YsyZ/CQ6lgcMH9zijoIRlu37bjs7S Tzr8KCjuaNFlEEdKVtBQSQc1YOQIj0/docq4hgIlrJgEdYUcBQ/gKSvcBzE/FuXjnByv CDs2AsQlmfIOjZmJqomMyyQJFKxRpZCSvMXWdTHd6Fzah8z1YSOZvF26ii1kth3tn4AP AqpA== 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 k1si1403051pgf.660.2017.11.09.04.14.13; Thu, 09 Nov 2017 04:14:24 -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 S1754215AbdKIMNe (ORCPT + 81 others); Thu, 9 Nov 2017 07:13:34 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:37822 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754041AbdKIMNd (ORCPT ); Thu, 9 Nov 2017 07:13:33 -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 vA9C8qec020092 for ; Thu, 9 Nov 2017 07:13:32 -0500 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0b-001b2d01.pphosted.com with ESMTP id 2e4kw1h22e-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 09 Nov 2017 07:13:32 -0500 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 9 Nov 2017 12:13:30 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 9 Nov 2017 12:13:27 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vA9CDRTm37552176; Thu, 9 Nov 2017 12:13:27 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E497AA4055; Thu, 9 Nov 2017 12:08:25 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A97F6A4053; Thu, 9 Nov 2017 12:08:24 +0000 (GMT) Received: from xenial-xerus.in.ibm.com (unknown [9.195.36.106]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 9 Nov 2017 12:08:24 +0000 (GMT) From: Anju T Sudhakar To: mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, maddy@linux.vnet.ibm.com, anju@linux.vnet.ibm.com Subject: [PATCH v3] powerpc/kernel/sysfs: Export ldbar spr to sysfs Date: Thu, 9 Nov 2017 17:43:24 +0530 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 17110912-0020-0000-0000-000003CA659A X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110912-0021-0000-0000-0000425F82A6 Message-Id: <1510229604-5839-1-git-send-email-anju@linux.vnet.ibm.com> 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-1711090173 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.7.4 From 1583591346951986820@xxx Thu Nov 09 12:26:35 +0000 2017 X-GM-THRID: 1582788336260680785 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread