All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/5] Privilege version update
@ 2022-01-20 20:07 ` Atish Patra
  0 siblings, 0 replies; 34+ messages in thread
From: Atish Patra @ 2022-01-20 20:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-riscv, Anup Patel, Bin Meng, Atish Patra, Alistair Francis,
	Palmer Dabbelt

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

Atish Patra (5):
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      |  10 ++
target/riscv/cpu_bits.h |  32 +++++++
target/riscv/csr.c      | 199 +++++++++++++++++++++++++++++++++-------
target/riscv/machine.c  |  26 ++++++
5 files changed, 237 insertions(+), 38 deletions(-)

--
2.30.2



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

end of thread, other threads:[~2022-02-03 21:28 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 20:07 [RFC 0/5] Privilege version update Atish Patra
2022-01-20 20:07 ` Atish Patra
2022-01-20 20:07 ` [RFC 1/5] target/riscv: Add the privileged spec version 1.12.0 Atish Patra
2022-01-20 20:07   ` Atish Patra
2022-01-24  7:59   ` Richard Henderson
2022-01-24  7:59     ` Richard Henderson
2022-01-29  0:52     ` Atish Kumar Patra
2022-01-29  0:52       ` Atish Kumar Patra
2022-01-31  6:33       ` Alistair Francis
2022-01-31  6:33         ` Alistair Francis
2022-01-20 20:07 ` [RFC 2/5] target/riscv: Introduce privilege version field in the CSR ops Atish Patra
2022-01-20 20:07   ` Atish Patra
2022-01-24  7:56   ` Richard Henderson
2022-01-24  7:56     ` Richard Henderson
2022-01-29  0:52     ` Atish Kumar Patra
2022-01-29  0:52       ` Atish Kumar Patra
2022-01-20 20:07 ` [RFC 3/5] target/riscv: Add support for mconfigptr Atish Patra
2022-01-20 20:07   ` Atish Patra
2022-01-20 20:07 ` [RFC 4/5] target/riscv: Add *envcfg* CSRs support Atish Patra
2022-01-20 20:07   ` Atish Patra
2022-01-26  8:37   ` Weiwei Li
2022-01-26  8:37     ` Weiwei Li
2022-01-29  1:28     ` Atish Patra
2022-01-29  1:28       ` Atish Patra
2022-01-29  1:50       ` angell1518
2022-01-31 20:05         ` Atish Kumar Patra
2022-01-31 20:05           ` Atish Kumar Patra
2022-02-03 12:23   ` Heiko Stübner
2022-02-03 20:39     ` Atish Kumar Patra
2022-02-03 20:39       ` Atish Kumar Patra
2022-01-20 20:07 ` [RFC 5/5] target/riscv: Enable privileged spec version 1.12 Atish Patra
2022-01-20 20:07   ` Atish Patra
2022-01-24 13:32   ` Christoph Müllner
2022-01-24 13:32     ` Christoph Müllner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.