OSDN Git Service

perf: riscv: preliminary RISC-V support
authorAlan Kao <alankao@andestech.com>
Thu, 19 Apr 2018 23:27:49 +0000 (07:27 +0800)
committerPalmer Dabbelt <palmer@sifive.com>
Mon, 4 Jun 2018 21:02:01 +0000 (14:02 -0700)
commit178e9fc47aaec1b8952b553444e94802d7570599
treeefa3bc88ef7dfdad550960dc9413ebdcda32727d
parent29dcea88779c856c7dc92040a0c01233263101d4
perf: riscv: preliminary RISC-V support

This patch provide a basic PMU, riscv_base_pmu, which supports two
general hardware event, instructions and cycles.  Furthermore, this
PMU serves as a reference implementation to ease the portings in
the future.

riscv_base_pmu should be able to run on any RISC-V machine that
conforms to the Priv-Spec.  Note that the latest qemu model hasn't
fully support a proper behavior of Priv-Spec 1.10 yet, but work
around should be easy with very small fixes.  Please check
https://github.com/riscv/riscv-qemu/pull/115 for future updates.

Cc: Nick Hu <nickhu@andestech.com>
Cc: Greentime Hu <greentime@andestech.com>
Signed-off-by: Alan Kao <alankao@andestech.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/Kconfig
arch/riscv/include/asm/Kbuild
arch/riscv/include/asm/perf_event.h [new file with mode: 0644]
arch/riscv/kernel/Makefile
arch/riscv/kernel/perf_event.c [new file with mode: 0644]