Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1693138rdb; Thu, 7 Dec 2023 06:30:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFA3RK+ZNyvZ+U97eXhGx5WXdMnxbDpo9InByBDIGrep70oyhTXeiSK/13s4QT1KQogurhL X-Received: by 2002:a17:902:d4ce:b0:1cc:5671:8d9 with SMTP id o14-20020a170902d4ce00b001cc567108d9mr6242491plg.27.1701959457873; Thu, 07 Dec 2023 06:30:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701959457; cv=none; d=google.com; s=arc-20160816; b=cRtDGjyBVv/dTOACsF/dgQpuskhyI73rGNIVw8+17EzSYfL3KAlCopiYrUvqjZKrLW tw3A+C2CP1neMzZQ3BSvJoa8K6e1Qke/u223M607jWg9QlevrPMYbUcgapUf99vdLDO1 YYrGZVJye0b4nEtbIZYbJYVbVzso8s3SEFm9X0c0Z/ca6Sm5m08ZBrAy6Wja26F8XXju Ao2wp2mxNXKPLrEVYTRh4BFVBiLCag4Its0EblXtig32Lk8A1bbEzWsksdBJq4hUmPWX BzF1V44wD/GBDepsbSflO+Zgz5hVhSBFUoFRr54YtAAxKx8XosNwIFXGdWLAmtqlTvUD UypQ== 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=o+vrQFgSoKTZO2A5Rdzo/XRCDPP2BiuuJUSfRaHALPE=; fh=pNgd1Gv3vj9w93x/4unDWE8U5ZJ3bdiNHxMZXh4o0ns=; b=i+PSljLeB5yKNNgsuECzG7mkjMEllmMnBkCz5+j5mN72QImFNySXPoAzhpayzHivNV /uBU0ZOpOZojsUXhOqKm6UCJ5J4DVeTslrYTptBXYb1ipi+T4tZtSisX1n6Va8+C2ZkD 3F9LwiV4WrqSu0mTGBy0OquiMDW03W7jMT/zs7YQ72aWBHwOGGtroGrLY1Wkf7J2Ldww gabq7WWuWh6g+0tR9EqjeWUgFQSqbPU8SmEQLbHFcA8kOvjZ1cyIYqD81MTEScc88nAJ Z9LdDD2PUhh/N0Ofu/TkZlHu1ny/wPiy6Kr8s5pOjrj9HBf4pdYYSpJ9v81/65PDZJTX wTOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id q4-20020a17090311c400b001cffe364a3esi1255496plh.233.2023.12.07.06.30.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 06:30:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2D8F680A5671; Thu, 7 Dec 2023 06:30:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235256AbjLGOad convert rfc822-to-8bit (ORCPT + 99 others); Thu, 7 Dec 2023 09:30:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232888AbjLGOac (ORCPT ); Thu, 7 Dec 2023 09:30:32 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E09B4126; Thu, 7 Dec 2023 06:30:34 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 232777FD3; Thu, 7 Dec 2023 22:30:32 +0800 (CST) Received: from EXMBX072.cuchost.com (172.16.6.82) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 7 Dec 2023 22:30:32 +0800 Received: from localhost.localdomain (202.188.176.82) by EXMBX072.cuchost.com (172.16.6.82) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 7 Dec 2023 22:30:24 +0800 From: Ji Sheng Teoh To: Jonathan Corbet , Will Deacon , "Mark Rutland" , Rob Herring , "Krzysztof Kozlowski" , Conor Dooley , Dan Williams , "Ilkka Koskinen" , Jonathan Cameron , Dave Jiang CC: Ji Sheng Teoh , Ley Foon Tan , , , , Subject: [PATCH v5 0/3] StarFive's StarLink PMU Support Date: Thu, 7 Dec 2023 22:29:37 +0800 Message-ID: <20231207142940.1794032-1-jisheng.teoh@starfivetech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [202.188.176.82] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX072.cuchost.com (172.16.6.82) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 07 Dec 2023 06:30:50 -0800 (PST) Changes since v4: - Add Reviewed-by tag from Conor to dt-bindings. - Add Documentation/admin-guide/perf/starfive_starlink_pmu.rst. - Rework starfive_starlink_pmu.c based on Jonathan's comment. Changes since v3: - Change dt-bindings filename along with the compatible field to "starfive,jh8100-starlink-pmu" with SOC specific naming convention. - Drop unused label defined in examples section in dt-bindings. - Update compatible field in starfive_starlink_pmu.c to the aforementioned. Changes since v2: - Change compatible field from generic "starfive,starlink-pmu" to "starfive,starlink-500-pmu" with specific IP versioning in bindings and driver. - Fix warning '-Wmissing-prototypes' reported by kernel test robot, by appending static to starlink_pmu_set_event_period() in starfive_starlink_pmu.c. Changes since v1: - Change 'depends on SOC_STARFIVE' to 'depends on ARCH_STARFIVE' in Kconfig ---- This patch series adds support for StarFive's Starlink Performance Monitor Unit(PMU). StarFive's StarLink PMU integrates one or more CPU cores with a shared L3 memory system. The PMU supports overflow interrupt, up to 16 programmable 64bit event counters, and an independent 64bit cycle counter. StarLink PMU is accessed via MMIO. Example Perf stat output: [root@user]# perf stat -a -e /starfive_starlink_pmu/cycles/ \ -e /starfive_starlink_pmu/read_miss/ \ -e /starfive_starlink_pmu/read_hit/ \ -e /starfive_starlink_pmu/release_request/ \ -e /starfive_starlink_pmu/write_hit/ \ -e /starfive_starlink_pmu/write_miss/ \ -e /starfive_starlink_pmu/write_request/ \ -e /starfive_starlink_pmu/writeback/ \ -e /starfive_starlink_pmu/read_request/ \ -- openssl speed rsa2048 Doing 2048 bits private rsa's for 10s: 5 2048 bits private RSA's in 2.84s Doing 2048 bits public rsa's for 10s: 169 2048 bits public RSA's in 2.42s version: 3.0.11 built on: Tue Sep 19 13:02:31 2023 UTC options: bn(64,64) CPUINFO: N/A sign verify sign/s verify/s rsa 2048 bits 0.568000s 0.014320s 1.8 69.8 ///////// Performance counter stats for 'system wide': 649991998 starfive_starlink_pmu/cycles/ 1009690 starfive_starlink_pmu/read_miss/ 1079750 starfive_starlink_pmu/read_hit/ 2089405 starfive_starlink_pmu/release_request/ 129 starfive_starlink_pmu/write_hit/ 70 starfive_starlink_pmu/write_miss/ 194 starfive_starlink_pmu/write_request/ 150080 starfive_starlink_pmu/writeback/ 2089423 starfive_starlink_pmu/read_request/ 27.062755678 seconds time elapsed Ji Sheng Teoh (3): perf: starfive: Add StarLink PMU support dt-bindings: perf: starfive: Add JH8100 StarLink PMU docs: perf: Add description for StarFive's StarLink PMU Documentation/admin-guide/perf/index.rst | 1 + .../perf/starfive_starlink_pmu.rst | 46 ++ .../perf/starfive,jh8100-starlink-pmu.yaml | 46 ++ drivers/perf/Kconfig | 9 + drivers/perf/Makefile | 1 + drivers/perf/starfive_starlink_pmu.c | 643 ++++++++++++++++++ 6 files changed, 746 insertions(+) create mode 100644 Documentation/admin-guide/perf/starfive_starlink_pmu.rst create mode 100644 Documentation/devicetree/bindings/perf/starfive,jh8100-starlink-pmu.yaml create mode 100644 drivers/perf/starfive_starlink_pmu.c -- 2.25.1