From patchwork Mon Aug 21 04:52:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 13691 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp2799320vqi; Sun, 20 Aug 2023 22:34:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfIrmSieyL7RFQCfp4KMh0Q9ixmAqa1CiRtPjXW6hWO00mDRXcJmK6pduE/JRtSNjkkcEk X-Received: by 2002:a05:6a20:a11b:b0:140:694:cd99 with SMTP id q27-20020a056a20a11b00b001400694cd99mr4531810pzk.44.1692596052505; Sun, 20 Aug 2023 22:34:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692596052; cv=none; d=google.com; s=arc-20160816; b=KP1R83kUKU0kgru7yhJYk9v1gC4KgoLyp9EM3nXLkCVwMtJtrF6omydzlDUlYRdxoo TRrpuk9umgGnAehXukQtN7+blBzTK2zwO6nPUtwRbf8PorGEcK4iQP8b0BTIyqZBZd3E yNkjLgV7Qqup+yB8Ok+pw8KNBGo2YrAohGjoy2IS0IlTMCENDqfcyWeqQJXf6CTJ3wAn R5HAuV25mNruF+2c08Mz2KFFWho5Aj7vlYFdc2ihoIX0TnWf9y9uauOIjTre0yHeMkb6 f4tYa84lT7LDkFITN0gqgtSszgq+i9zSLT+TSObYn/NMObSv+IYNx5muGyxow9m0gZKM EWSA== 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; bh=MDyYH4ARNnw6KaUmrrtLdPVJYGxF5w0RKJ7fCQlahzY=; fh=i7k4OkcaLUFocIK64fg5M0UL6Z7MqFc0/WYsE6IUDvI=; b=brKq8DV+mIoKqWtYuhYtjQprdYTDBydJttG0ZFNLLXBmbLQCzpm3qIimlMaoYVBx+m Xv9RgUzkjbZjbYzpDEsLJncBrcG4OwUVEEFs08t0oouDhELd6QJTBGoTAahdSME2NZCm udunVENlC7I4SnyAzst0uLtOCxBK9vt+pMBz8OxEWwP+w5TpwxgGa/SiQCBMQRUl2lgd hoXPlCEBvyN7a17ANupDAfW63vMG7vvTnnrnXUsdf+hQ51HBf9pAMJA6lLhP/HKTQYlF GtojN/uxYZm2jGTXI0cQcnxpX9RSnpxKs/2KVqJU9JB0acsJODHmtyYIHcgXUmNRF9j2 IvBg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l190-20020a6391c7000000b0056955d2e859si5072405pge.878.2023.08.20.22.33.50; Sun, 20 Aug 2023 22:34:12 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232981AbjHUEwd (ORCPT + 99 others); Mon, 21 Aug 2023 00:52:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbjHUEwc (ORCPT ); Mon, 21 Aug 2023 00:52:32 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 71252A3; Sun, 20 Aug 2023 21:52:30 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BFFF91FB; Sun, 20 Aug 2023 21:53:10 -0700 (PDT) Received: from a077893.blr.arm.com (a077893.blr.arm.com [10.162.42.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BF25F3F740; Sun, 20 Aug 2023 21:52:25 -0700 (PDT) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Cc: Anshuman Khandual , Catalin Marinas , Will Deacon , Mike Leach , James Clark , Leo Yan , Jonathan Corbet , linux-doc@vger.kernel.org, coresight@lists.linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH V5 0/3] coresight: etm: Make cycle count threshold user configurable Date: Mon, 21 Aug 2023 10:22:13 +0530 Message-Id: <20230821045216.641499-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774815598531982040 X-GMAIL-MSGID: 1774815598531982040 This series makes ETM TRCCCCTRL based 'cc_threshold' user configurable via the perf event attribute. But first, this implements an errata work around affecting ETM TRCIDR3.CCITMIN value on certain cpus, overriding the field. This series applies on v6.5-rc7. Cc: Catalin Marinas Cc: Will Deacon Cc: Suzuki K Poulose Cc: Mike Leach Cc: James Clark Cc: Leo Yan Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Changes in V5: - Replaced 'where as' with single word 'whereas' - Reworked 'cc_threshold' fallback to ETM_CYC_THRESHOLD_DEFAULT Changes in V4: https://lore.kernel.org/all/20230818112051.594986-1-anshuman.khandual@arm.com/ - Fixed a typo s/rangess/ranges, - Renamed etm4_work_around_wrong_ccitmin() as etm4_core_reads_wrong_ccitmin() - Moved drvdata->ccitmin value check for 256 inside etm4_core_reads_wrong_ccitmin() - Moved the comment inside etm4_core_reads_wrong_ccitmin() Changes in V3: https://lore.kernel.org/all/20230811034600.944386-1-anshuman.khandual@arm.com/ - Added errata work around affecting TRCIDR3.CCITMIN - Split the document update into a separate patch Changes in V2: https://lore.kernel.org/all/20230808074533.380537-1-anshuman.khandual@arm.com/ - s/treshhold/threshold Changes in V1: https://lore.kernel.org/all/20230804044720.1478900-1-anshuman.khandual@arm.com/ Anshuman Khandual (3): coresight: etm: Override TRCIDR3.CCITMIN on errata affected cpus coresight: etm: Make cycle count threshold user configurable Documentation: coresight: Add cc_threshold tunable Documentation/arch/arm64/silicon-errata.rst | 10 +++++ Documentation/trace/coresight/coresight.rst | 4 ++ .../hwtracing/coresight/coresight-etm-perf.c | 2 + .../coresight/coresight-etm4x-core.c | 45 ++++++++++++++++++- 4 files changed, 59 insertions(+), 2 deletions(-)