All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikita Shubin <nikita.shubin@maquefel.me>
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	[thread overview]
Message-ID: <20220607131648.29439-1-nikita.shubin@maquefel.me> (raw)

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

-- 
2.35.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

             reply	other threads:[~2022-06-07 13:17 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 13:16 Nikita Shubin [this message]
2022-06-07 13:16 ` [PATCH v3 1/4] RISC-V: Create unique identification for SoC PMU Nikita Shubin
2022-06-07 13:16   ` Nikita Shubin
2022-06-07 13:16   ` Nikita Shubin
2022-06-07 16:37   ` Atish Patra
2022-06-07 16:37     ` Atish Patra
2022-06-07 16:37     ` Atish Patra
2022-06-08  8:47     ` Nikita Shubin
2022-06-08  8:47       ` Nikita Shubin
2022-06-08  8:47       ` Nikita Shubin
2022-06-14 10:16   ` Sunil V L
2022-06-14 10:16     ` Sunil V L
2022-06-14 10:16     ` Sunil V L
2022-06-07 13:16 ` [PATCH v3 2/4] RISC-V: Support CPUID for risc-v in perf Nikita Shubin
2022-06-07 13:16   ` Nikita Shubin
2022-06-07 13:16   ` Nikita Shubin
2022-06-09 13:54   ` Will Deacon
2022-06-09 13:54     ` Will Deacon
2022-06-09 13:54     ` Will Deacon
2022-06-07 13:16 ` [PATCH v3 3/4] RISC-V: Added generic pmu-events mapfile Nikita Shubin
2022-06-07 13:16   ` Nikita Shubin
2022-06-08 10:45   ` John Garry
2022-06-08 10:45     ` John Garry
2022-06-08 14:41     ` Nikita Shubin
2022-06-08 14:41       ` Nikita Shubin
2022-06-08 15:51       ` John Garry
2022-06-08 15:51         ` John Garry
2022-06-07 13:16 ` [PATCH v3 4/4] RISC-V: Added HiFive Unmatched PMU events Nikita Shubin
2022-06-07 13:16   ` Nikita Shubin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220607131648.29439-1-nikita.shubin@maquefel.me \
    --to=nikita.shubin@maquefel.me \
    --cc=aou@eecs.berkeley.edu \
    --cc=genevieve.chan@starfivetech.com \
    --cc=linux-riscv@lists.infradead.org \
    --cc=n.shubin@yadro.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.