linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] riscv: pmu: Add support for Control Transfer Records Ext.
@ 2025-01-16 23:09 Rajnesh Kanwal
  2025-01-16 23:09 ` [PATCH v2 1/7] perf: Increase the maximum number of samples to 256 Rajnesh Kanwal
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Rajnesh Kanwal @ 2025-01-16 23:09 UTC (permalink / raw)
  To: linux-kernel, linux-riscv
  Cc: linux-perf-users, adrian.hunter, alexander.shishkin, ajones, anup,
	acme, atishp, beeman, brauner, conor, heiko, irogers, mingo,
	james.clark, renyu.zj, jolsa, jisheng.teoh, palmer, will,
	kaiwenxue1, vincent.chen, Rajnesh Kanwal

This series enables Control Transfer Records extension support on riscv
architecture. This extension is similar to Arch LBR in x86 and BRBE in ARM.
The Extension has been ratified and the latest release can be found here [0]

CTR extension depends on both the implementation of S-mode and Sscsrind
extension v1.0.0 [1]. CTR access ctrsource, ctrtartget and ctrdata CSRs using
sscsrind extension.

The series is based on Smcdeleg/Ssccfg counter delegation extension [2]
patches [3]. CTR itself doesn't depend on counter delegation support. This
rebase is basically to include the Smcsrind patches.

The last patch is in the perf tool to allow processing 256 entries. Without
this perf seems to consider that sample as corrupted and discards it.

Here is the link to a quick guide [4] to setup and run a basic perf demo on
Linux to use CTR Ext.

Qemu patches can be found here:
https://github.com/rajnesh-kanwal/qemu/tree/b4/ctr_upstream_v5

Opensbi patch can be found here:
https://github.com/rajnesh-kanwal/opensbi/tree/ctr_upstream_v2

Linux kernel patches can be found here:
https://github.com/rajnesh-kanwal/linux/tree/b4/ctr_upstream_v2

[0]: https://github.com/riscv/riscv-control-transfer-records/releases/tag/v1.0
[1]: https://github.com/riscvarchive/riscv-indirect-csr-access/releases/tag/v1.0.0
[2]: https://github.com/riscvarchive/riscv-smcdeleg-ssccfg/releases/tag/v1.0.0
[3]: https://lore.kernel.org/lkml/20250114-counter_delegation-v2-0-8ba74cdb851b@rivosinc.com/
[4]: https://github.com/rajnesh-kanwal/linux/wiki/Running-CTR-basic-demo-on-QEMU-RISC%E2%80%90V-Virt-machine

Rajnesh Kanwal (7):
  perf: Increase the maximum number of samples to 256.
  riscv: pmu: Add Control transfer records CSR definations.
  riscv: Add Control Transfer Records extension parsing
  dt-bindings: riscv: add Sxctr ISA extension description
  riscv: pmu: Add infrastructure for Control Transfer Record
  riscv: pmu: Add driver for Control Transfer Records Ext.
  riscv: pmu: Integrate CTR Ext support in riscv_pmu_dev driver

 .../devicetree/bindings/riscv/extensions.yaml |  14 +
 MAINTAINERS                                   |   1 +
 arch/riscv/include/asm/csr.h                  |  83 +++
 arch/riscv/include/asm/hwcap.h                |   4 +
 arch/riscv/kernel/cpufeature.c                |   2 +
 drivers/perf/Kconfig                          |  11 +
 drivers/perf/Makefile                         |   1 +
 drivers/perf/riscv_ctr.c                      | 608 ++++++++++++++++++
 drivers/perf/riscv_pmu_common.c               |  23 +-
 drivers/perf/riscv_pmu_dev.c                  |  82 +++
 drivers/perf/riscv_pmu_legacy.c               |   2 +
 include/linux/perf/riscv_pmu.h                |  55 ++
 tools/perf/util/machine.c                     |  21 +-
 13 files changed, 898 insertions(+), 9 deletions(-)
 create mode 100644 drivers/perf/riscv_ctr.c

-- 
2.34.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-05-21 17:40 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 23:09 [PATCH v2 0/7] riscv: pmu: Add support for Control Transfer Records Ext Rajnesh Kanwal
2025-01-16 23:09 ` [PATCH v2 1/7] perf: Increase the maximum number of samples to 256 Rajnesh Kanwal
2025-02-20 18:51   ` Ian Rogers
2025-04-17 12:51     ` Rajnesh Kanwal
2025-05-21 10:47       ` Rajnesh Kanwal
2025-05-21 15:36         ` Ian Rogers
2025-05-21 17:40           ` Rajnesh Kanwal
2025-01-16 23:09 ` [PATCH v2 2/7] riscv: pmu: Add Control transfer records CSR definations Rajnesh Kanwal
2025-01-16 23:09 ` [PATCH v2 3/7] riscv: Add Control Transfer Records extension parsing Rajnesh Kanwal
2025-01-16 23:09 ` [PATCH v2 4/7] dt-bindings: riscv: add Sxctr ISA extension description Rajnesh Kanwal
2025-01-17  7:26   ` Krzysztof Kozlowski
2025-01-20 14:31     ` Rajnesh Kanwal
2025-01-20 18:49   ` Conor Dooley
2025-01-16 23:09 ` [PATCH v2 5/7] riscv: pmu: Add infrastructure for Control Transfer Record Rajnesh Kanwal
2025-01-16 23:09 ` [PATCH v2 6/7] riscv: pmu: Add driver for Control Transfer Records Ext Rajnesh Kanwal
2025-01-16 23:09 ` [PATCH v2 7/7] riscv: pmu: Integrate CTR Ext support in riscv_pmu_dev driver Rajnesh Kanwal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).