qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/6] Privilege version update
@ 2022-02-06  9:18 Atish Patra
  2022-02-06  9:18 ` [PATCH v3 1/6] target/riscv: Define simpler privileged spec version numbering Atish Patra
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Atish Patra @ 2022-02-06  9:18 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alistair Francis, Bin Meng, Atish Patra, Palmer Dabbelt,
	qemu-riscv

RISC-V International (RVI) has ratified many RISC-V ISA extensions recently[1].
The privileged specification version is also upgraded to v1.12. It means
certain CSRs introduced in v1.12 should only be accessible only if the
priv specification version supported is equal or greater than v1.12.
Doing this check in predicate function is not scalable as there will be
new CSRs introduced in the future versions of the privileged specification.

This series tries to address this problem by adding a field in the csr_ops
which can be checked in csrrw function before invoking the predicate function.
To keep the code churn to minimum, it is assumed that the minimum version of
the privilege version supported for any CSR is v1.10 unless specified
explicitly in the csr_ops table. Any new CSRs introduced in v1.12 have been
updated accordingly.

This will work fine for any ratified extensions. However, it is bit unclear
what should be done for the stable draft extensions. My suggestion is not
to update the priv field in the CSR ops table until the extension is
marked experimental (i.e. not frozen/ratified). Once the extension is
ratified and graduated from experimental to available stage, the privileged
spec version should be updated in the csr table if required. I am open to
other suggestions as well.

[1] https://wiki.riscv.org/display/TECH/Recently+Ratified+Extensions

This series is rebased on top of the AIA v8 to avoid conflicts.

Changes from v2->v3:
1. Only update the bits defined in *envcfg CSR

Changes from v1->v2:
1. Unified both [m/h]envcfg & [m/h]envcfgh into one.
2. Changed the priv spec version enumeration
3. Improved csr_ops table to provide better redability.
4. Fixed the compilation error for CONFIG_USER_ONLY
5. Rebased on top of the AIA series.

Atish Patra (6):
target/riscv: Define simpler privileged spec version numbering
target/riscv: Add the privileged spec version 1.12.0
target/riscv: Introduce privilege version field in the CSR ops.
target/riscv: Add support for mconfigptr
target/riscv: Add *envcfg* CSRs support
target/riscv: Enable privileged spec version 1.12

target/riscv/cpu.c      |   8 +-
target/riscv/cpu.h      |  15 ++-
target/riscv/cpu_bits.h |  40 ++++++++
target/riscv/csr.c      | 217 +++++++++++++++++++++++++++++++++-------
target/riscv/machine.c  |  24 +++++
5 files changed, 264 insertions(+), 40 deletions(-)

--
2.30.2



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

end of thread, other threads:[~2022-02-22 20:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-06  9:18 [PATCH v3 0/6] Privilege version update Atish Patra
2022-02-06  9:18 ` [PATCH v3 1/6] target/riscv: Define simpler privileged spec version numbering Atish Patra
2022-02-21 21:37   ` Alistair Francis
2022-02-06  9:18 ` [PATCH v3 2/6] target/riscv: Add the privileged spec version 1.12.0 Atish Patra
2022-02-21 21:38   ` Alistair Francis
2022-02-06  9:18 ` [PATCH v3 3/6] target/riscv: Introduce privilege version field in the CSR ops Atish Patra
2022-02-21 21:41   ` Alistair Francis
2022-02-22 20:37     ` Atish Patra
2022-02-06  9:18 ` [PATCH v3 4/6] target/riscv: Add support for mconfigptr Atish Patra
2022-02-21 21:41   ` Alistair Francis
2022-02-06  9:18 ` [PATCH v3 5/6] target/riscv: Add *envcfg* CSRs support Atish Patra
2022-02-06  9:18 ` [PATCH v3 6/6] target/riscv: Enable privileged spec version 1.12 Atish Patra
2022-02-21 21:40   ` Alistair Francis

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).