Skip to content

risc-v: Add ISA extension smcntrpmf support

Kaiwen Xue qemu-devel qemu-riscv 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3target/riscv: Add cycle & instret privilege mode filtering propertiestarget/riscv/cpu.c target/riscv/cpu_cfg.h+3 -02 replies
2/3target/riscv: Add cycle & instret privilege mode filtering definitionstarget/riscv/cpu.h target/riscv/cpu_bits.h+35 -00 replies
3/3target/riscv: Add cycle & instret privilege mode filtering supporttarget/riscv/csr.c+73 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] risc-v: Add ISA extension smcntrpmf support

This patch series adds the support for RISC-V ISA extension smcntrpmf (cycle and privilege mode filtering) [1]. QEMU only calculates dummy cycles and instructions, so there is no actual means to stop the icount in QEMU. Therefore, this series only add the read/write behavior of the relevant CSRs such that the implemented firmware support [2] can work without causing unnecessary illegal instruction exceptions.

[1] https://github.com/riscv/riscv-smcntrpmf
[2] https://github.com/rivosinc/opensbi/tree/dev/kaiwenx/smcntrpmf_upstream

Kaiwen Xue (3):
target/riscv: Add cycle & instret privilege mode filtering properties target/riscv: Add cycle & instret privilege mode filtering definitions target/riscv: Add cycle & instret privilege mode filtering support

 target/riscv/cpu.c      |  2 ++
 target/riscv/cpu.h      |  6 ++++
 target/riscv/cpu_bits.h | 29 ++++++++++++++++
 target/riscv/cpu_cfg.h  |  1 +
 target/riscv/csr.c      | 73 +++++++++++++++++++++++++++++++++++++++++
 5 files changed, 111 insertions(+)
Signature · 1 line
2.34.1