Message ID | 20220607131648.29439-1-nikita.shubin@maquefel.me (mailing list archive) |
---|---|
Headers | show
Return-Path: <linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 807C9C433EF for <linux-riscv@archiver.kernel.org>; Tue, 7 Jun 2022 13:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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-Owner; bh=v5ZLmGbHCLDRp5r16Za+jtmAwH1o33RAYuuldIuZ2O8=; b=hA3LQB/mbak4qT q7d0LLqY34wwoUnT8CzqY8bPjaU21WViaBgsZZgtodrdknPPiNfQfYLENdXSTr2DEaWh/GWahHrdu SKGkzZyZB+EwYvetxARmTlp4G6gb5aNeQmfj/9RUffXerFhgN5LyuwygqiQmRF1ci+anT8EkKoPaf z/HGBKBucNh6WkATxomY3vlgmBCHDBRTZibF3bLY7qXWqj2WTPr9OVR8nlCL4ZESJwsnVr015mWNo juJ5Dd/i5VABxWMylohzrcHcyFZEwdNyy4xFA5Tqfg1i9Xnz0069iRZiT2OHClMhHez14mnzOI3vl YEPSwKGICCljPquq7HRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyZ53-007cPR-Jd; Tue, 07 Jun 2022 13:17:09 +0000 Received: from forward102p.mail.yandex.net ([2a02:6b8:0:1472:2741:0:8b7:102]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nyZ4x-007cJq-NF for linux-riscv@lists.infradead.org; Tue, 07 Jun 2022 13:17:07 +0000 Received: from myt5-6f58ffe13ff5.qloud-c.yandex.net (myt5-6f58ffe13ff5.qloud-c.yandex.net [IPv6:2a02:6b8:c12:3998:0:640:6f58:ffe1]) by forward102p.mail.yandex.net (Yandex) with ESMTP id C43203940448; Tue, 7 Jun 2022 16:16:52 +0300 (MSK) Received: from myt6-654ec0a0ab93.qloud-c.yandex.net (myt6-654ec0a0ab93.qloud-c.yandex.net [2a02:6b8:c12:1d80:0:640:654e:c0a0]) by myt5-6f58ffe13ff5.qloud-c.yandex.net (mxback/Yandex) with ESMTP id ppOtZO6pHq-Gof4nswX; Tue, 07 Jun 2022 16:16:52 +0300 X-Yandex-Fwd: 2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maquefel.me; s=mail; t=1654607812; bh=ruIzGDkTnWqR5rQVP4jNY3qUlTQRJox4LfVANkCdoho=; h=Date:Subject:Cc:To:From:Message-Id; b=NMZooYb8WWDFiNpfIFNBaKIRJiwTz8upBxH2V20mi2MKrXpKCnRF41fVhIWjZlihB 3C5Y2WbSbAkrQqUC7jxLd4Q2d8iC1+GFqQUdtPVVh4Gnw1pzbP0ESTl2I+L+pYBgAm dNk8SkSBC/et9LaKhORmzGAn4sN5A1sYWURqYwSc= Authentication-Results: myt5-6f58ffe13ff5.qloud-c.yandex.net; dkim=pass header.i=@maquefel.me Received: by myt6-654ec0a0ab93.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id sOXgg17Zrk-GoM4UUpT; Tue, 07 Jun 2022 16:16:50 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Nikita Shubin <nikita.shubin@maquefel.me> To: Cc: Genevieve Chan <genevieve.chan@starfivetech.com>, Nikita Shubin <n.shubin@yadro.com>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, linux-riscv@lists.infradead.org (open list:RISC-V ARCHITECTURE) Subject: [PATCH v3 0/4] Introduce pmu-events support for HiFive Unmatched Date: Tue, 7 Jun 2022 16:16:43 +0300 Message-Id: <20220607131648.29439-1-nikita.shubin@maquefel.me> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220607_061705_100719_87064118 X-CRM114-Status: GOOD ( 10.45 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-riscv.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-riscv/> List-Post: <mailto:linux-riscv@lists.infradead.org> List-Help: <mailto:linux-riscv-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-riscv>, <mailto:linux-riscv-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-riscv" <linux-riscv-bounces@lists.infradead.org> Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org |
Series |
Introduce pmu-events support for HiFive Unmatched
|
expand
|
From: Nikita Shubin <n.shubin@yadro.com> This series of patches introduces support for the RISC-V PMU identification and raw events matching between perf and the PMU. The HiFive Unmatched board can now use all the counters with named events. Unfortunately Mario is no longer interested in submitting this series, as there were no objections to v2 series, besides DT bindings which reside in U-Boot and shouldn't be exposed to Linux, i resending mostly original series with small sysfs pmu id fix. See original cover letter by João Mário Domingos: https://patchwork.kernel.org/project/linux-riscv/cover/20211116154812.17008-1-joao.mario@tecnico.ulisboa.pt/ Following addition was made to U-Boot device tree: ``` pmu { compatible = "riscv,pmu"; riscv,event-to-mhpmcounters = <0x03 0x06 0x18 0x10001 0x10002 0x18 0x10009 0x10009 0x18 0x10011 0x10011 0x18 0x10019 0x10019 0x18 0x10021 0x10021 0x18>; riscv,event-to-mhpmevent = <0x03 0x00000000 0x1801 0x04 0x00000000 0x0302 0x05 0x00000000 0x4000 0x06 0x00000000 0x6001 0x10001 0x00000000 0x0202 0x10002 0x00000000 0x0402 0x10009 0x00000000 0x0102 0x10011 0x00000000 0x2002 0x10019 0x00000000 0x1002 0x10021 0x00000000 0x0802>; riscv,raw-event-to-mhpmcounters = <0x00000000 0x03ffff00 0x0 0x0 0x18 0x00000000 0x0007ff01 0x0 0x1 0x18 0x00000000 0x00003f02 0x0 0x2 0x18>; }; ``` Tested on the top of v5.19 which contains Atish Patra PMU series. --- Changes in v3: - Change 'soc/soc:pmu/id' to 'riscv-pmu/id' Changes in v2: - Fix compilation errors and warnings - Remove space idents - Correct formatting --- João Mário Domingos (4): RISC-V: Create unique identification for SoC PMU RISC-V: Support CPUID for risc-v in perf RISC-V: Added generic pmu-events mapfile RISC-V: Added HiFive Unmatched PMU events arch/riscv/kernel/sbi.c | 3 + drivers/perf/riscv_pmu.c | 18 ++++ drivers/perf/riscv_pmu_sbi.c | 47 ++++++++++ tools/perf/arch/riscv/util/Build | 1 + tools/perf/arch/riscv/util/header.c | 66 +++++++++++++ tools/perf/pmu-events/arch/riscv/mapfile.csv | 15 +++ .../pmu-events/arch/riscv/riscv-generic.json | 20 ++++ .../arch/riscv/sifive/u74/instructions.json | 92 +++++++++++++++++++ .../arch/riscv/sifive/u74/memory.json | 32 +++++++ .../arch/riscv/sifive/u74/microarch.json | 57 ++++++++++++ 10 files changed, 351 insertions(+) create mode 100644 tools/perf/arch/riscv/util/header.c create mode 100644 tools/perf/pmu-events/arch/riscv/mapfile.csv create mode 100644 tools/perf/pmu-events/arch/riscv/riscv-generic.json create mode 100644 tools/perf/pmu-events/arch/riscv/sifive/u74/instructions.json create mode 100644 tools/perf/pmu-events/arch/riscv/sifive/u74/memory.json create mode 100644 tools/perf/pmu-events/arch/riscv/sifive/u74/microarch.json