Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7771299rwp; Tue, 18 Jul 2023 23:15:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlH1j5Ir4QLrr6vfHlyiU9WcQtBVDCoyFqT5rZe86UCqOAsHLdnpLanjQFQ0I667QCz8iPZm X-Received: by 2002:a17:906:fe4a:b0:982:cfe2:32fe with SMTP id wz10-20020a170906fe4a00b00982cfe232femr1993277ejb.63.1689747330318; Tue, 18 Jul 2023 23:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689747330; cv=none; d=google.com; s=arc-20160816; b=qcu+X99o4XhMMt8bHXeg7Qmmc4rysMIrLeMlLk33IJ4qWH3ynhnakpTpNa9jc8irrN U0eienH66iYRJ//SE9GahcmKXjQK+HMfISRUDQq+Vzp/FqJqsZoMYpqru5LuKkgY6apu jr0G2gC4q9EYgAg673rsTgoiJTy+asE7H+nE5W+GmE2czjds/k0C9rE6+TswVOkPEoQ2 4JhJRvjXTdh2q2jCZTx77XE/n+A3zlizw6Zqub+FZqyP+oYG7IerCeMyRT7XmZiTqN9O k1+JU+fSNOeLDi5W1SOFSt6Ukgb9Cq5eaPK695JmSJUS4B+slQhg9TAFQp55WI2buzUu BwLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=V39H711HKU9/skviqQuB5rlaLN3pdUAYy7qVwSsavpo=; fh=lluApPZKvgBfehyE3YkEDiG1ZnF0SxL3enV3I5H2lAw=; b=Lalj7nLgf8YFZWVkglcaUIrXjdI48WjrWo1z1ZahS1c454YgK83wnFBd38ffW4x6J9 VZk9/O0vgZOi8CYvqtayVglJ1gJhHuDYjSj9v+tK/g481IF4VGhodBr0aOnwdabwjLvL APU7R860yvPnNvm17xutW7snzKQlJp8YJC0EGlAcLETdwo5pMoJQqkMc72Nqh0NPllEY zsbKEc2rJYa7CF7MMUHVYmJe/fUz2V/YiG+YakEMiI9PVBHs5K5QT1hqaQFy4CduJb3J ThKWHsn9aGYJr1mzHon99N+6iukFzt/qk/0KOj53CD+sADK0YxJW+oA+1E7Mr71mfMTb zLmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=h+MS0CIF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lc10-20020a170906f90a00b009874842217bsi2331741ejb.441.2023.07.18.23.15.05; Tue, 18 Jul 2023 23:15:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=h+MS0CIF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbjGSGNH (ORCPT + 99 others); Wed, 19 Jul 2023 02:13:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbjGSGNE (ORCPT ); Wed, 19 Jul 2023 02:13:04 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 922361BF7; Tue, 18 Jul 2023 23:13:02 -0700 (PDT) Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36J659ER012739; Wed, 19 Jul 2023 06:12:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=V39H711HKU9/skviqQuB5rlaLN3pdUAYy7qVwSsavpo=; b=h+MS0CIFIo5RcPVOchnE4Xis0/0pkagyZ9OiHQolpHqf1CUNeV9y3MzTVDZG1cun65cK 1OxTT3mbwTziPwdI6PtfRu6vnAttp2ocxXJbLSg2EaIgKqp0yWO5VIUQCLV5runY7Qi4 u7PMyngKeO956d2cDhpSywqm1eJ0gH9zBtX62K3MPPahTTwmwip7XIjxOKtcmhR5i8yM O3uZHxTYfGLPCmz2ueCcnPL2Kgfd4Vx8eMzxyFMQjA+YvjyowZlWrkv/pSfa5c1t2Cr3 SHqu67Q64Lu16iqYrNQSQ5QLOD4pf7UudCOI9T/lX1Qbez5d2AKmEuFFkDsrqPGhdzQ9 XQ== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rx8r521h9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jul 2023 06:12:54 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 36J4FVLD003394; Wed, 19 Jul 2023 06:12:52 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3rv65xg9wx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 19 Jul 2023 06:12:52 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 36J6Cn2u26084058 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Jul 2023 06:12:49 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 69ACC2004B; Wed, 19 Jul 2023 06:12:49 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D195F20043; Wed, 19 Jul 2023 06:12:41 +0000 (GMT) Received: from li-e8dccbcc-2adc-11b2-a85c-bc1f33b9b810.ibm.com.com (unknown [9.43.119.126]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 19 Jul 2023 06:12:41 +0000 (GMT) From: Kajol Jain To: mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, maddy@linux.ibm.com, atrajeev@linux.vnet.ibm.com, disgoel@linux.ibm.com, kjain@linux.ibm.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, rdunlap@infradead.org Subject: [PATCH v3 00/10] Add sysfs interface files to hv_gpci device to expose system information Date: Wed, 19 Jul 2023 11:42:21 +0530 Message-Id: <20230719061231.631410-1-kjain@linux.ibm.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: UExQLTK3jIWcCPoRbaouRauOYSoc68xt X-Proofpoint-ORIG-GUID: UExQLTK3jIWcCPoRbaouRauOYSoc68xt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-19_02,2023-07-18_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 impostorscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2307190056 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The hcall H_GET_PERF_COUNTER_INFO can be used to get data related to chips, dimms and system topology, by passing different counter request values. Patchset adds sysfs files to "/sys/devices/hv_gpci/interface/" of hv_gpci pmu driver, which will expose system topology information using H_GET_PERF_COUNTER_INFO hcall. The added sysfs files are available for power10 and above platforms and needs root access to read the data. Patches 1,3,5,7,9 adds sysfs interface files to the hv_gpci pmu driver, to get system topology information. List of added sysfs files: -> processor_bus_topology (Counter request value : 0xD0) -> processor_config (Counter request value : 0x90) -> affinity_domain_via_virtual_processor (Counter request value : 0xA0) -> affinity_domain_via_domain (Counter request value : 0xB0) -> affinity_domain_via_partition (Counter request value : 0xB1) Patches 2,4,6,8,10 adds details of the newly added hv_gpci interface files listed above in the ABI documentation. Patches 2,4,6,8,10 adds details of the newly added hv_gpci interface files listed above in the ABI documentation. Changelog: v2 -> v3 -> Make nit changes in documentation patches as suggested by Randy Dunlap. v1 -> v2 -> Incase the HCALL fails with errors that can be resolve during runtime, then only add sysinfo interface attributes to the interface_attrs attribute array. Even if one of the counter request value HCALL fails, don't add any sysinfo attribute to the interface_attrs attribute array. Add the code changes to make sure sysinfo interface added only when all the requirements met as suggested by Michael Ellerman. -> Make changes in documentation, adds detail of errors type which can be resolved at runtime as suggested by Michael Ellerman. -> Add new enum and sysinfo_counter_request array to get required counter request value in hv-gpci.c file. -> Move the macros for interface attribute array index to hv-gpci.c, as these macros currently only used in hv-gpci.c file. Kajol Jain (10): powerpc/hv_gpci: Add sysfs file inside hv_gpci device to show processor bus topology information docs: ABI: sysfs-bus-event_source-devices-hv_gpci: Document processor_bus_topology sysfs interface file powerpc/hv_gpci: Add sysfs file inside hv_gpci device to show processor config information docs: ABI: sysfs-bus-event_source-devices-hv_gpci: Document processor_config sysfs interface file powerpc/hv_gpci: Add sysfs file inside hv_gpci device to show affinity domain via virtual processor information docs: ABI: sysfs-bus-event_source-devices-hv_gpci: Document affinity_domain_via_virtual_processor sysfs interface file powerpc/hv_gpci: Add sysfs file inside hv_gpci device to show affinity domain via domain information docs: ABI: sysfs-bus-event_source-devices-hv_gpci: Document affinity_domain_via_domain sysfs interface file powerpc/hv_gpci: Add sysfs file inside hv_gpci device to show affinity domain via partition information docs: ABI: sysfs-bus-event_source-devices-hv_gpci: Document affinity_domain_via_partition sysfs interface file .../sysfs-bus-event_source-devices-hv_gpci | 160 +++++ arch/powerpc/perf/hv-gpci.c | 640 +++++++++++++++++- 2 files changed, 798 insertions(+), 2 deletions(-) -- 2.39.3