public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/3] perf: RISC-V: fix access to the highest available counter
@ 2022-06-23 11:27 Sergey Matyukevich
  2022-06-23 11:27 ` [PATCH 1/3] perf: RISC-V: fix access beyond allocated array Sergey Matyukevich
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sergey Matyukevich @ 2022-06-23 11:27 UTC (permalink / raw)
  To: linux-riscv; +Cc: Atish Patra, Anup Patel, Sergey Matyukevich

Hi all,

This patch series suggests some fixes and improvements for the bookkeeping
of the PMU counter indexes. The first patch fixes pmu_ctr_list array size
to prevent memory access beyond the allocated array. The second patch
fixes access to the highest available PMU counter.

The accompanying OpenSBI fix is available for review here:
- https://github.com/riscv-software-src/opensbi/pull/260

Note that if custom SBI firmware does not support firmware events, then
current driver behavior makes inaccessible the hardware counter with
the highest index.

Finally, the third patch attempts to provide support for any gaps in PMU
counter indexes. For this purpose pmu_ctr_list array is replaced by IDR.

Regards,
Sergey

Sergey Matyukevich (3):
  perf: RISC-V: fix access beyond allocated array
  perf: RISC-V: allow to use the highest available counter
  perf: RISC-V: support noncontiguous pmu counter IDs

 drivers/perf/riscv_pmu_legacy.c |  4 +-
 drivers/perf/riscv_pmu_sbi.c    | 88 +++++++++++++++++++++++----------
 include/linux/perf/riscv_pmu.h  |  2 +-
 3 files changed, 65 insertions(+), 29 deletions(-)

-- 
2.36.1


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

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

end of thread, other threads:[~2022-06-23 18:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-23 11:27 [PATCH 0/3] perf: RISC-V: fix access to the highest available counter Sergey Matyukevich
2022-06-23 11:27 ` [PATCH 1/3] perf: RISC-V: fix access beyond allocated array Sergey Matyukevich
2022-06-23 17:50   ` Atish Patra
2022-06-23 18:10     ` Sergey Matyukevich
2022-06-23 11:27 ` [PATCH 2/3] perf: RISC-V: allow to use the highest available counter Sergey Matyukevich
2022-06-23 17:59   ` Atish Patra
2022-06-23 11:27 ` [PATCH 3/3] perf: RISC-V: support noncontiguous pmu counter IDs Sergey Matyukevich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox