Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Unverified Commit ee95b88d authored by Viacheslav Mitrofanov's avatar Viacheslav Mitrofanov Committed by Palmer Dabbelt
Browse files

perf: RISC-V: Limit the number of counters returned from SBI


Perf gets the number of supported counters from SBI. If it happens that
the number of returned counters more than RISCV_MAX_COUNTERS the code
trusts it. It does not lead to an immediate problem but can potentially
lead to it. Prevent getting more than RISCV_MAX_COUNTERS from SBI.

Signed-off-by: default avatarViacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: default avatarAndrew Jones <ajones@ventanamicro.com>
Reviewed-by: default avatarAtish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20230505072058.1049732-1-v.v.mitrofanov@yadro.com


Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 4681daca
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment