From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31C1F606A325 for ; Fri, 20 Nov 2026 15:26:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=t9Vi8yCw; dkim=pass (2048-bit key) header.d=fb.com header.i=@fb.com header.a=rsa-sha256 header.s=pps82601-s2048-2026-q3 header.b=np8/aHj3 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=NruqjrzalzzTg4oV6juNI3CdG+RLSbvEqYvadZ0/8lo=; b=t9Vi8yCwwykdXiMChl+SA6pko+ zPyT5iDneiGEdAk0PNsjoe2FjqjTZXuHzZQkj+bVVDiifZilI+AFUYdHVfg2lYG3tYdO7yyp0U0gj 43EOGEyTzKQS6oG/TYEHA/FojEjFbmE5JZZRveoiUnjPXlBlooERQsuc7s3/5OICTnD3oj8L80pHm Z7Ben2vtTdK1FWDIq23G6Ay3jHIWHzVSEj8tIOfiMj+hlbdQ/3EtGe4anYKs29w4jHiBhGW8kTdMe 8soPqkbgaDPHFVB0U+mv4teQSsx/022CUXOrmILEDrtoMuCczf6tvo54TDzVEVbsoCid97tPQDytO TrYAvkyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xUQUv-0000000FPaw-2bgQ; Fri, 20 Nov 2026 15:25:57 +0000 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xUQUU-0000000FPJm-0Z6G for linux-arm-kernel@lists.infradead.org; Fri, 20 Nov 2026 15:25:35 +0000 Received: from pps.filterd (m0528004.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AKEfS0o1873902; Fri, 20 Nov 2026 07:24:58 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pps82601-s2048-2026-q3; bh=Nruqjrzal zzTg4oV6juNI3CdG+RLSbvEqYvadZ0/8lo=; b=np8/aHj3LHQWW9++k8OBg0QKn 0P7aNARqZYV2xfSsbVVblDs3Mh39LX8aQQcR9Q58l0hRKBMlABYUBn8vjAYzIkbH on+XG/gopHjHFN0lUvWddGiY6LxcFcj+fnhjYI05vViWt9Zj+Z5+1JiFYKyXYb9x O9ka+RoiOIWL61KQjM95TTmzfB5SR8BoDTsGJgE6GibLE0PcSwkGOvWwnC0UXp3T 7y7kGy/b8YvbNO8jkgG9AcdTc0hM7039W8y+ERT7HZI7wBSpwnWnzBvHbTFc1Psz LEXKXAB7DMHuRTqkhdAO+2myPu++raK57xX6e1oxy4pZElTMH1f0CWZHclolg== Received: from mail.thefacebook.com ([163.114.134.16]) by mx0a-00082601.pphosted.com (PPS) with ESMTPS id 4j1yjp2hw0-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 20 Nov 2026 07:24:58 -0800 (PST) Received: from localhost (2620:10d:c085:208::7cb7) by mail.thefacebook.com (2620:10d:c08b:78::c78f) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.56; Fri, 20 Nov 2026 15:24:50 +0000 From: Amir Ayupov To: James Clark , Leo Yan , Suzuki K Poulose , Mike Leach , Alexander Shishkin CC: Will Deacon , Mark Rutland , Greg Kroah-Hartman , Jonathan Corbet , Mathieu Poirier , Randy Dunlap , Shuah Khan , Daniel Pereira , , , , , Subject: [PATCH v5 0/7] coresight: Pulse an ETM external output for a PMU event Date: Fri, 20 Nov 2026 07:21:13 -0800 Message-ID: X-Mailer: git-send-email 2.52.1 X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTIwMDA2MSBTYWx0ZWRfX0Zo74rK81oG7 lR0oc/HFzFp8C77Yv3lq9fdS0V86nUeFPVIflkcTg2MgDygeNL2F0rB8tOTKQ1FMXRz8+n5HcHh Yr528WIhrRsuvCumum4muYhZARMy/lTwtuPXqKMMjf8iJGmyQ5OpG4Fmxs8li9KwizdKZJEEUZN gJ9j7JZo+QFy/P9k1uwrWGdahNISothRlFkpIWZf3BUoSmFA5QYM+gbdLCAT2BYppXQLWWOuz3I Y73DVTmnbJtY+yuvlyr6lrG05TL6KFZZvKmGPQupYAWj41AVzn9N7FJnd0MCYKUfj5woHLxt7Qi Hw9z3psKtKlERKb+TUUtvF/LAwi+Ldj3Les+o8b2Q7IcHPVwtOnqfBy3iyRyh+7Py8ihr3MsS0H 0RTSiY0OwIABVfQS19Rhyzvqo9O8Fh2x4NUdnfkunfuhOiE7gvAnB7x+gYLMGwIqc47EaqhkPPR gSO4Jx/sAXgc+klSEAA== X-Proofpoint-Spam-Info: AW1haW4tMjYxMTIwMDA2MSBTYWx0ZWRfXwxoU52NhYTNw v9Q0L1j9pXQsV/8c959PuX2v5mK9ATFAtXslaUB9YflT+Jxps6f4kDy33SR946csNRBlU3kqw/x uCKYPeqRQ/IdIKv/caA0x8Ukya2ZoxU= X-Proofpoint-GUID: HDMQrvRP0TjTS39IVLi8BmK-j6vasnN- X-Authority-Analysis: v=2.4 cv=aPtlOr9m c=1 sm=1 tr=0 ts=6b00664a cx=c_pps a=CB4LiSf2rd0gKozIdrpkBw==:117 a=CB4LiSf2rd0gKozIdrpkBw==:17 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=7x6HtfJdh03M6CCDgxCd:22 a=GbPsI2Ihf5RTnMjR_gZv:22 a=VwQbUJbxAAAA:8 a=FOH2dFAWAAAA:8 a=jm_8UMYxSsQ4F8tPgyoA:9 X-Proofpoint-ORIG-GUID: HDMQrvRP0TjTS39IVLi8BmK-j6vasnN- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-20_05,2026-11-19_01,2025-10-01_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261120_072530_534634_34DD996A X-CRM114-Status: GOOD ( 18.98 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Add an ETMv4 configuration, pmu_pulse, that drives trace unit external output 1 on every traced cycle, so a PMU event counting it (TRCEXTOUT1) can end a fixed-length ETM window, for example with aux-action=pause. The feature only loads on an ETE whose PMU counts its external outputs. Output 1 is fixed by the configuration; the perf command selects the matching TRCEXTOUT1 consumer separately. Output 0 is avoided because it is the trace trigger, and a detected trigger stops TRBE capture. Each window includes the counted trace cycles plus pause interrupt latency. Patch 1 is Leo's fix for TRCIDR0.NUMEVENT decoding, which patch 6 relies on for the number of external outputs. An ARM PMU maintainer Ack is requested on patch 5 so the series can be taken through the CoreSight tree. Changes in v5: - Compare the class and capability fields with FIELD_GET() (Suzuki). The class check stays an intersection: built-in features name a single class, while ETMv4 devices register with both SRC_ALL and SRC_ETM4. - Move both ARMV8_PMUV3_MAX_COMMON_EVENTS and ARMV8_PMUV3_EXT_COMMON_EVENT_BASE to linux/perf/arm_pmuv3.h and include it from linux/perf/arm_pmu.h (Suzuki, James). Add Will and Mark for an Ack on that patch. - Rename the capability to CS_CFG_MATCH_CAP_ETE_TRCEXTOUT, as it only applies to ETE (Suzuki). - Drop caps.trcextout and pass the probe-time result to etm4_cscfg_register() instead (Suzuki). The check reads PMCEID on the trace unit's CPU, so it stays in etm4_init_arch_data(), which runs there, while etm4_cscfg_register() may run on any CPU. - Add James's Reviewed-by to all but patch 2, and Leo's Tested-by to all. - Link to v4: https://lore.kernel.org/r/cover.1792989860.git.aaupov@fb.com Changes in v4: - Fix the arm64 build: v3 defined pmuv3_event_implemented() in linux/perf/arm_pmuv3.h after including asm/arm_pmuv3.h, which broke files that include asm/arm_pmuv3.h directly, such as arch/arm64/kernel/cpufeature.c. Move it to the arm64 asm/arm_pmuv3.h, after the helpers it uses. Breakage reported by kernel test robot. - Link to v3: https://lore.kernel.org/r/cover.1792907332.git.aaupov@fb.com Changes in v3: - Rebase onto coresight next, which moves the capability fields into drvdata->caps (Leo). - Carry Leo's "coresight: etm4x: Fix event count decoding" (Leo). - Add Leo's Reviewed-by to "Fail to enable a configuration not loaded on the device". - Define CS_CFG_MATCH_CLASS_MASK and CS_CFG_MATCH_CAP_MASK with GENMASK_U32() and split the match check into early returns (Leo). The class check stays an intersection, as ETMv4 devices register with SRC_ALL | SRC_ETM4 while the built-in features only set SRC_ETM4. - Remove the unused CS_CFG_MATCH_INST_ANY in a separate patch (Leo). - Replace the per-output CS_CFG_MATCH_CAP_PMU_EXTOUT(n) bits with a single CS_CFG_MATCH_CAP_TRCEXTOUT, set on ETE only (Leo, James). - Check the PMU events through a new pmuv3_event_implemented() helper instead of open-coding PMCEID0_EL0 in etm4x (James). - Use PMU-agnostic event names in the documentation example (Daniel). - Add Daniel's Reviewed-by to "Add pmu_pulse/extout_pulse". - Link to v2: https://lore.kernel.org/r/20261012230527.750567-1-aaupov@fb.com Amir Ayupov (6): coresight: syscfg: Fail to enable a configuration not loaded on the device coresight: syscfg: Match feature capabilities separately from device class coresight: syscfg: Remove unused CS_CFG_MATCH_INST_ANY perf: arm_pmuv3: Add pmuv3_event_implemented() coresight: etm4x: Report whether the PMU counts the external outputs coresight: Add pmu_pulse/extout_pulse Leo Yan (1): coresight: etm4x: Fix event count decoding .../trace/coresight/coresight-config.rst | 5 + .../trace/coresight/coresight-perf.rst | 15 +++ arch/arm64/include/asm/arm_pmuv3.h | 20 ++++ drivers/hwtracing/coresight/Makefile | 1 + .../coresight/coresight-cfg-pmu-pulse.c | 55 +++++++++++ .../coresight/coresight-cfg-preload.c | 2 + .../coresight/coresight-cfg-preload.h | 2 + .../hwtracing/coresight/coresight-config.h | 11 ++- .../hwtracing/coresight/coresight-etm4x-cfg.c | 7 +- .../hwtracing/coresight/coresight-etm4x-cfg.h | 2 +- .../coresight/coresight-etm4x-core.c | 42 ++++++++- .../coresight/coresight-etm4x-sysfs.c | 29 +++--- .../coresight/coresight-syscfg-configfs.c | 3 + .../hwtracing/coresight/coresight-syscfg.c | 93 ++++++++++++------- include/linux/perf/arm_pmu.h | 3 +- include/linux/perf/arm_pmuv3.h | 8 ++ 16 files changed, 239 insertions(+), 59 deletions(-) create mode 100644 drivers/hwtracing/coresight/coresight-cfg-pmu-pulse.c base-commit: 343cfcbb3ecfdb80aa576a428cfa3b65ad783842 -- 2.52.1