qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 00/11] Add RISC-V ISA extension smcntrpmf support
@ 2024-06-26 23:57 Atish Patra
  2024-06-26 23:57 ` [PATCH v7 01/11] target/riscv: Combine set_mode and set_virt functions Atish Patra
                   ` (10 more replies)
  0 siblings, 11 replies; 27+ messages in thread
From: Atish Patra @ 2024-06-26 23:57 UTC (permalink / raw)
  To: qemu-riscv, qemu-devel
  Cc: Rajnesh Kanwal, Atish Patra, palmer, liwei1518, zhiwei_liu,
	bin.meng, dbarboza, alistair.francis, Kaiwen Xue

This patch series adds the support for RISC-V ISA extension smcntrpmf (cycle and
privilege mode filtering) [1]. It is based on Kevin's earlier work but improves
it by actually implement privilege mode filtering by tracking the privilege
mode switches. This enables the privilege mode filtering for mhpmcounters as
well. However, Smcntrpmf/Sscofpmf must be enabled to leverage this.

The series is also available at [2] as well.

Changes from v6->v7:
1. Fixed a compilation issue.

Changes from v5->v6:
1. Rebased on top of alister/riscv-to-apply.next (c50aabe132) and icount fix
   patch[4] which may cause conflicts.
2. Fixed a bug in pmf logic related to VS<->HS transition and same mode
   recording.
3. Merged assorted fixes PR as the changes are intertwined. [2]
4. Fix counter inhibit CSR behavior. This change now start counters from both
   mhpmcounter and mcountinhibit writes. Previously cycle/inst timer was
   only started on mhpmcounterx write.
5. Optimized the PMU timer setup code.

Changes from v4->v5:
1. Rebased on top of master(158a054c4d1a).
2. Fixed a bug for VS<->HS transition.

Changes from v3->v4:
1. Fixed the ordering of the ISA extension names in isa_edata_arr.
2. Added RB tags.

Changes from v2->v3:
1. Fixed the rebasing error in PATCH2.
2. Added RB tags.
3. Addressed other review comments.

Changes from v1->v2:
1. Implemented actual mode filtering for both icount and host ticks mode.
1. Addressed comments in v1.
2. Added Kevin's personal email address.

[1] https://github.com/riscv/riscv-smcntrpmf
[2] https://github.com/atishp04/qemu/tree/b4/smcntrpmf_v7
[3] https://lore.kernel.org/all/20240429-countinhibit_fix-v1-0-802ec1e99133@rivosinc.com/
[4] https://lore.kernel.org/qemu-riscv/20240618112649.76683-1-cleger@rivosinc.com/

Cc: Rajnesh Kanwal <rkanwal@rivosinc.com>

Signed-off-by: Atish Patra <atishp@rivosinc.com>
---
Atish Patra (5):
      target/riscv: Fix the predicate functions for mhpmeventhX CSRs
      target/riscv: Implement privilege mode filtering for cycle/instret
      target/riscv: Save counter values during countinhibit update
      target/riscv: Enforce WARL behavior for scounteren/hcounteren
      target/riscv: Do not setup pmu timer if OF is disabled

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

Rajnesh Kanwal (3):
      target/riscv: Combine set_mode and set_virt functions.
      target/riscv: Start counters from both mhpmcounter and mcountinhibit
      target/riscv: More accurately model priv mode filtering.

 target/riscv/cpu.c        |   2 +
 target/riscv/cpu.h        |  20 ++-
 target/riscv/cpu_bits.h   |  34 +++++
 target/riscv/cpu_cfg.h    |   1 +
 target/riscv/cpu_helper.c |  66 +++++----
 target/riscv/csr.c        | 358 +++++++++++++++++++++++++++++++++++-----------
 target/riscv/machine.c    |   5 +-
 target/riscv/op_helper.c  |  17 +--
 target/riscv/pmu.c        | 181 ++++++++++++++++++++---
 target/riscv/pmu.h        |   4 +
 10 files changed, 543 insertions(+), 145 deletions(-)
---
base-commit: 842a3d79a0e37cd3d685c4728308fac0d9bfd0bb
change-id: 20240626-smcntrpmf_v7-3b275d1da117
--
Regards,
Atish patra



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

end of thread, other threads:[~2024-07-10  7:39 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-26 23:57 [PATCH v7 00/11] Add RISC-V ISA extension smcntrpmf support Atish Patra
2024-06-26 23:57 ` [PATCH v7 01/11] target/riscv: Combine set_mode and set_virt functions Atish Patra
2024-07-01 18:21   ` Daniel Henrique Barboza
2024-07-03  1:07   ` Alistair Francis
2024-06-26 23:57 ` [PATCH v7 02/11] target/riscv: Fix the predicate functions for mhpmeventhX CSRs Atish Patra
2024-06-26 23:57 ` [PATCH v7 03/11] target/riscv: Add cycle & instret privilege mode filtering properties Atish Patra
2024-07-01 19:10   ` Daniel Henrique Barboza
2024-07-03  2:02   ` Alistair Francis
2024-07-10  7:03     ` Atish Kumar Patra
2024-06-26 23:57 ` [PATCH v7 04/11] target/riscv: Add cycle & instret privilege mode filtering definitions Atish Patra
2024-07-03  1:12   ` Alistair Francis
2024-06-26 23:57 ` [PATCH v7 05/11] target/riscv: Add cycle & instret privilege mode filtering support Atish Patra
2024-07-03  1:19   ` Alistair Francis
2024-07-10  7:38     ` Atish Kumar Patra
2024-06-26 23:57 ` [PATCH v7 06/11] target/riscv: Implement privilege mode filtering for cycle/instret Atish Patra
2024-07-01 19:29   ` Daniel Henrique Barboza
2024-07-03  1:25   ` Alistair Francis
2024-06-26 23:57 ` [PATCH v7 07/11] target/riscv: Save counter values during countinhibit update Atish Patra
2024-07-01 19:34   ` Daniel Henrique Barboza
2024-07-03  2:03   ` Alistair Francis
2024-06-26 23:57 ` [PATCH v7 08/11] target/riscv: Enforce WARL behavior for scounteren/hcounteren Atish Patra
2024-06-26 23:57 ` [PATCH v7 09/11] target/riscv: Start counters from both mhpmcounter and mcountinhibit Atish Patra
2024-07-01 19:37   ` Daniel Henrique Barboza
2024-06-26 23:57 ` [PATCH v7 10/11] target/riscv: More accurately model priv mode filtering Atish Patra
2024-07-01 19:37   ` Daniel Henrique Barboza
2024-06-26 23:57 ` [PATCH v7 11/11] target/riscv: Do not setup pmu timer if OF is disabled Atish Patra
2024-07-01 19:39   ` Daniel Henrique Barboza

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).