Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp3394366rdb; Thu, 16 Nov 2023 08:24:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQxBJbrsCvoOnHm8LAP/yGB8nNAapsclxgA/OXvVvkIUIop/0wif3j8d2Qo09YU+2g2Nq3 X-Received: by 2002:a05:6870:4994:b0:1e9:c224:bb91 with SMTP id ho20-20020a056870499400b001e9c224bb91mr20850074oab.38.1700151858640; Thu, 16 Nov 2023 08:24:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700151858; cv=none; d=google.com; s=arc-20160816; b=owRs9xoxYbCTAy1m0kia0nP+Js0VVJ3T5UnnGXIiImbfg6sPwtHTBNlp5xYZlDj1Wg ZF9VwJz+uwVbainqtyeRf0St62zGeMZjB/IYv+RhEn+iBVUP+U049CJdskT3zieOa27L c5O7BnAJxZavDEeCfqCRSyZo9y4sipLXbsCSEqe5444j/ClKkoOSpqIAGrRIzvIZwrno gJldRziYbgv99acGKrlgKpctTR24PEDghzNBt4r7XlYEU2JUluK5wU9vz9QMlKn9UIHG zbGKjSPuWluVtKcrmku8SrVhgRmaFg/ODr2sWjQFkw/R1q0lYIj5mNr4mUyEB+r+ie6a KFVQ== 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=Hy5rY67MQwS11Bu+BQqXsEw5/k18hw5l25CHsBUJVt8=; fh=a1bPo2tcbvKF45zrTCtiiG8dvdKbK9OFOyZwKKjcBKk=; b=dYhb8CPjN7Nl9/YD5J9cV4m55UvHEwmAZ4fGIQNTEmFdC7ktv3eoe+uOxnauVOBZKV sGZlAvehYdRSLNZeFpvaGMzhf+dlygUen/2ik28G7c977066JNd2gm/wvayKtJ18H/97 MouAJiYORVChADEV0SWKtaLYJ8f733OdRnjM/F76G0lfiVT6PoIxCxm+WcPSfBdkJoRA qF01k3y8IEyBkY0ou9WcgLCYDhz3DS2N3Ni24uVNW9n/PYYxVkcq7IKIiWuCPXRl5Wqy RK4P0s2zOoPF0y5CFhda4JdaTSIH/yw0LX/k8M96I++7k/kdgd79VJhubzAwulIKXryA SW0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id l8-20020a056870d3c800b001e9831102f5si4756407oag.22.2023.11.16.08.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Nov 2023 08:24:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 9D9E581D7A7F; Thu, 16 Nov 2023 08:24:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230340AbjKPQYR convert rfc822-to-8bit (ORCPT + 99 others); Thu, 16 Nov 2023 11:24:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjKPQYQ (ORCPT ); Thu, 16 Nov 2023 11:24:16 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 808DEA5; Thu, 16 Nov 2023 08:24:11 -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 5EFB17FFB; Fri, 17 Nov 2023 00:24:08 +0800 (CST) Received: from EXMBX172.cuchost.com (172.16.6.92) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 17 Nov 2023 00:24:08 +0800 Received: from localhost.localdomain (202.188.176.82) by EXMBX172.cuchost.com (172.16.6.92) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 17 Nov 2023 00:24:04 +0800 From: Ji Sheng Teoh To: Will Deacon , Mark Rutland , "Rob Herring" , Krzysztof Kozlowski , Conor Dooley , Thomas Gleixner , Peter Zijlstra CC: Ji Sheng Teoh , Ley Foon Tan , , , Subject: [PATCH v4 0/2] StarFive's StarLink PMU Support Date: Fri, 17 Nov 2023 00:23:28 +0800 Message-ID: <20231116162330.1144983-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: EXCAS062.cuchost.com (172.16.6.22) To EXMBX172.cuchost.com (172.16.6.92) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 16 Nov 2023 08:24:17 -0800 (PST) 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 (2): perf: starfive: Add StarLink PMU support dt-bindings: perf: starfive: Add JH8100 StarLink PMU .../perf/starfive,jh8100-starlink-pmu.yaml | 46 ++ drivers/perf/Kconfig | 9 + drivers/perf/Makefile | 1 + drivers/perf/starfive_starlink_pmu.c | 654 ++++++++++++++++++ include/linux/cpuhotplug.h | 1 + 5 files changed, 711 insertions(+) create mode 100644 Documentation/devicetree/bindings/perf/starfive,jh8100-starlink-pmu.yaml create mode 100644 drivers/perf/starfive_starlink_pmu.c -- 2.25.1