riscv: Prepare for user-space perf event mmap support
authorAlexandre Ghiti <alexghiti@rivosinc.com>
Wed, 2 Aug 2023 08:03:23 +0000 (10:03 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 16 Aug 2023 14:28:19 +0000 (07:28 -0700)
commit83c5e13b8cbbed9479cf568e03a5010d827e9781
treea8b56e1d74bb303a6d885f2f2d525c6f64733d3e
parentd5ac062d82d87124ac75e4273e3887578a7fae60
riscv: Prepare for user-space perf event mmap support

Provide all the necessary bits in the generic riscv pmu driver to be
able to mmap perf events in userspace: the heavy lifting lies in the
driver backend, namely the legacy and sbi implementations.

Note that arch_perf_update_userpage is almost a copy of arm64 code.

Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
drivers/perf/riscv_pmu.c
include/linux/perf/riscv_pmu.h