public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles
@ 2022-11-03 12:26 Tsukasa OI
  2022-11-03 12:26 ` [REVIEW ONLY 1/2] NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs Tsukasa OI
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Tsukasa OI @ 2022-11-03 12:26 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

Hello,

This patchset implements all extensions from RISC-V Profiles (but not
profile itself).  I'm not sure whether this patchset helps someone
implementing RISC-V Profiles but I hope so.

Thanks,
Tsukasa




Tsukasa OI (2):
  NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs
  NEAR-RATIFICATION RISC-V: Add platform property/capability extensions

 bfd/elfxx-riscv.c                           | 38 +++++++++++++++-
 gas/config/tc-riscv.c                       | 20 +++++----
 gas/testsuite/gas/riscv/csr-version-1p10.l  | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr-version-1p11.l  | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr-version-1p12.l  | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr-version-1p9p1.l | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr.s               |  2 +-
 gas/testsuite/gas/riscv/smstateen-csr-s.d   | 22 ++++++++++
 gas/testsuite/gas/riscv/ssstateen-csr.d     | 22 ++++++++++
 gas/testsuite/gas/riscv/ssstateen-csr.s     | 13 ++++++
 include/opcode/riscv-opc.h                  | 26 +++++------
 11 files changed, 215 insertions(+), 120 deletions(-)
 create mode 100644 gas/testsuite/gas/riscv/smstateen-csr-s.d
 create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.d
 create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.s


base-commit: ae1c45ead6b60ef0fd338bbeb6a4c5e5808c6e6a
-- 
2.37.2


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

* [REVIEW ONLY 1/2] NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs
  2022-11-03 12:26 [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
@ 2022-11-03 12:26 ` Tsukasa OI
  2022-11-03 12:26 ` [REVIEW ONLY 2/2] NEAR-RATIFICATION RISC-V: Add platform property/capability extensions Tsukasa OI
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: Tsukasa OI @ 2022-11-03 12:26 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

[DO NOT MERGE]
RISC-V Profiles are frozen but -- from my view -- this document will still
change in some way.  Meanwhile, this patch should not be merged upstream.
This commit uses tentative version 1.0 (same as 'Smstateen').

This commit adds 'Ssstateen' extension, which is a supervisor-visible view
of the 'Smstateen' extension.  It means, this extension implements sstateen*
and hstateen* CSRs of the 'Smstateen' extension.

Note that 'Smstateen' extension itself is unchanged but due to
implementation simplicity, it is implemented so that 'Smstateen' implies
'Ssstateen' (just like 'M' implies 'Zmmul').

This is based on the latest version of RISC-V Profiles (version 0.9-draft):
<https://github.com/riscv/riscv-profiles/commit/226b7f643067b29abc6723fac60d5f6d3f9eb901>

bfd/ChangeLog:

	* elfxx-riscv.c (riscv_implicit_subsets): Update implication rules.
	(riscv_supported_std_s_ext) Add 'Ssstateen' extension.

gas/ChangeLog:

	* config/tc-riscv.c (enum riscv_csr_class): Rename
	CSR_CLASS_SMSTATEEN_AND_H{,_32} to CSR_CLASS_SSSTATEEN_...
	Add CSR_CLASS_SSSTATEEN.
	(riscv_csr_address): Support new/renamed CSR classes.
	* testsuite/gas/riscv/csr.s: Add 'Ssstateen' extension to comment.
	* testsuite/gas/riscv/csr-version-1p9p1.l: Reflect changes to
	error messages.
	* testsuite/gas/riscv/csr-version-1p10.l: Likewise.
	* testsuite/gas/riscv/csr-version-1p11.l: Likewise.
	* testsuite/gas/riscv/csr-version-1p12.l: Likewise.
	* testsuite/gas/riscv/ssstateen-csr.s: Test for 'Ssstateen' CSRs.
	* testsuite/gas/riscv/ssstateen-csr.d: Likewise.
	* testsuite/gas/riscv/smstateen-csr-s.d: Test to make sure that
	supervisor/hypervisor part of 'Smstateen' CSRs are accessible from
	'RV32IH_Smstateen', not just from 'RV32IH_Ssstateen' that is tested
	in ssstateen-csr.d.

include/ChangeLog:

	* opcode/riscv-opc.h: Update DECLARE_CSR declarations with
	new CSR classes.
---
 bfd/elfxx-riscv.c                           |  4 +-
 gas/config/tc-riscv.c                       | 20 +++++----
 gas/testsuite/gas/riscv/csr-version-1p10.l  | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr-version-1p11.l  | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr-version-1p12.l  | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr-version-1p9p1.l | 48 ++++++++++-----------
 gas/testsuite/gas/riscv/csr.s               |  2 +-
 gas/testsuite/gas/riscv/smstateen-csr-s.d   | 22 ++++++++++
 gas/testsuite/gas/riscv/ssstateen-csr.d     | 22 ++++++++++
 gas/testsuite/gas/riscv/ssstateen-csr.s     | 13 ++++++
 include/opcode/riscv-opc.h                  | 26 +++++------
 11 files changed, 182 insertions(+), 119 deletions(-)
 create mode 100644 gas/testsuite/gas/riscv/smstateen-csr-s.d
 create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.d
 create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.s

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 94bff0e0388..781b57cbd98 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1097,9 +1097,10 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"zks", "zbkx",	check_implicit_always},
   {"zks", "zksed",	check_implicit_always},
   {"zks", "zksh",	check_implicit_always},
+  {"smstateen", "ssstateen",	check_implicit_always},
   {"smepmp", "zicsr",		check_implicit_always},
-  {"smstateen", "zicsr",	check_implicit_always},
   {"sscofpmf", "zicsr",		check_implicit_always},
+  {"ssstateen", "zicsr",	check_implicit_always},
   {"sstc", "zicsr",		check_implicit_always},
   {NULL, NULL, NULL}
 };
@@ -1219,6 +1220,7 @@ static struct riscv_supported_ext riscv_supported_std_s_ext[] =
   {"smepmp",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"sscofpmf",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"ssstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"sstc",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svinval",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svnapot",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index 2dc92ecd3c3..019545171f5 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -69,9 +69,10 @@ enum riscv_csr_class
   CSR_CLASS_H,		/* hypervisor */
   CSR_CLASS_H_32,	/* hypervisor, rv32 only */
   CSR_CLASS_SMSTATEEN,		/* Smstateen only */
-  CSR_CLASS_SMSTATEEN_AND_H,	/* Smstateen only (with H) */
   CSR_CLASS_SMSTATEEN_32,	/* Smstateen RV32 only */
-  CSR_CLASS_SMSTATEEN_AND_H_32,	/* Smstateen RV32 only (with H) */
+  CSR_CLASS_SSSTATEEN,		/* S[ms]stateen only */
+  CSR_CLASS_SSSTATEEN_AND_H,	/* S[ms]stateen only (with H) */
+  CSR_CLASS_SSSTATEEN_AND_H_32,	/* S[ms]stateen RV32 only (with H) */
   CSR_CLASS_SSCOFPMF,		/* Sscofpmf only */
   CSR_CLASS_SSCOFPMF_32,	/* Sscofpmf RV32 only */
   CSR_CLASS_SSTC,		/* Sstc only */
@@ -1029,15 +1030,18 @@ riscv_csr_address (const char *csr_name,
       extension = "zve32x";
       break;
     case CSR_CLASS_SMSTATEEN:
-    case CSR_CLASS_SMSTATEEN_AND_H:
     case CSR_CLASS_SMSTATEEN_32:
-    case CSR_CLASS_SMSTATEEN_AND_H_32:
-      is_rv32_only = (csr_class == CSR_CLASS_SMSTATEEN_32
-		      || csr_class == CSR_CLASS_SMSTATEEN_AND_H_32);
-      is_h_required = (csr_class == CSR_CLASS_SMSTATEEN_AND_H
-		      || csr_class == CSR_CLASS_SMSTATEEN_AND_H_32);
+      is_rv32_only = (csr_class == CSR_CLASS_SMSTATEEN_32);
       extension = "smstateen";
       break;
+    case CSR_CLASS_SSSTATEEN:
+    case CSR_CLASS_SSSTATEEN_AND_H:
+    case CSR_CLASS_SSSTATEEN_AND_H_32:
+      is_rv32_only = (csr_class == CSR_CLASS_SSSTATEEN_AND_H_32);
+      is_h_required = (csr_class == CSR_CLASS_SSSTATEEN_AND_H
+		      || csr_class == CSR_CLASS_SSSTATEEN_AND_H_32);
+      extension = "ssstateen";
+      break;
     case CSR_CLASS_SSCOFPMF_32:
       is_rv32_only = true;
       /* Fall through.  */
diff --git a/gas/testsuite/gas/riscv/csr-version-1p10.l b/gas/testsuite/gas/riscv/csr-version-1p10.l
index 999e9af1520..03af32d3bef 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p10.l
+++ b/gas/testsuite/gas/riscv/csr-version-1p10.l
@@ -419,30 +419,30 @@
 .*Warning: invalid CSR `mstateen2', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen3', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen3', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen0', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen0', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen1', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen1', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen2', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen2', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen3', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `sstateen0', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen0', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen1', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen1', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen2', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen2', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen3', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0', needs `h' extension
-.*Warning: invalid CSR `hstateen0', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0', needs `h' extension
-.*Warning: invalid CSR `hstateen0', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1', needs `h' extension
-.*Warning: invalid CSR `hstateen1', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1', needs `h' extension
-.*Warning: invalid CSR `hstateen1', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2', needs `h' extension
-.*Warning: invalid CSR `hstateen2', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2', needs `h' extension
-.*Warning: invalid CSR `hstateen2', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3', needs `h' extension
-.*Warning: invalid CSR `hstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3', needs `h' extension
-.*Warning: invalid CSR `hstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `mstateen0h', needs rv32i extension
 .*Warning: invalid CSR `mstateen0h', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen0h', needs rv32i extension
@@ -461,28 +461,28 @@
 .*Warning: invalid CSR `mstateen3h', needs `smstateen' extension
 .*Warning: invalid CSR `hstateen0h', needs rv32i extension
 .*Warning: invalid CSR `hstateen0h', needs `h' extension
-.*Warning: invalid CSR `hstateen0h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0h', needs rv32i extension
 .*Warning: invalid CSR `hstateen0h', needs `h' extension
-.*Warning: invalid CSR `hstateen0h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1h', needs rv32i extension
 .*Warning: invalid CSR `hstateen1h', needs `h' extension
-.*Warning: invalid CSR `hstateen1h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1h', needs rv32i extension
 .*Warning: invalid CSR `hstateen1h', needs `h' extension
-.*Warning: invalid CSR `hstateen1h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2h', needs rv32i extension
 .*Warning: invalid CSR `hstateen2h', needs `h' extension
-.*Warning: invalid CSR `hstateen2h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2h', needs rv32i extension
 .*Warning: invalid CSR `hstateen2h', needs `h' extension
-.*Warning: invalid CSR `hstateen2h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3h', needs rv32i extension
 .*Warning: invalid CSR `hstateen3h', needs `h' extension
-.*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3h', needs rv32i extension
 .*Warning: invalid CSR `hstateen3h', needs `h' extension
-.*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3h', needs `ssstateen' extension
 .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
 .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
 .*Warning: read-only CSR is written `csrw scountovf,a1'
diff --git a/gas/testsuite/gas/riscv/csr-version-1p11.l b/gas/testsuite/gas/riscv/csr-version-1p11.l
index a099e4ecc93..0766c2263ec 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p11.l
+++ b/gas/testsuite/gas/riscv/csr-version-1p11.l
@@ -417,30 +417,30 @@
 .*Warning: invalid CSR `mstateen2', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen3', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen3', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen0', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen0', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen1', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen1', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen2', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen2', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen3', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `sstateen0', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen0', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen1', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen1', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen2', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen2', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen3', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0', needs `h' extension
-.*Warning: invalid CSR `hstateen0', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0', needs `h' extension
-.*Warning: invalid CSR `hstateen0', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1', needs `h' extension
-.*Warning: invalid CSR `hstateen1', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1', needs `h' extension
-.*Warning: invalid CSR `hstateen1', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2', needs `h' extension
-.*Warning: invalid CSR `hstateen2', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2', needs `h' extension
-.*Warning: invalid CSR `hstateen2', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3', needs `h' extension
-.*Warning: invalid CSR `hstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3', needs `h' extension
-.*Warning: invalid CSR `hstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `mstateen0h', needs rv32i extension
 .*Warning: invalid CSR `mstateen0h', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen0h', needs rv32i extension
@@ -459,28 +459,28 @@
 .*Warning: invalid CSR `mstateen3h', needs `smstateen' extension
 .*Warning: invalid CSR `hstateen0h', needs rv32i extension
 .*Warning: invalid CSR `hstateen0h', needs `h' extension
-.*Warning: invalid CSR `hstateen0h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0h', needs rv32i extension
 .*Warning: invalid CSR `hstateen0h', needs `h' extension
-.*Warning: invalid CSR `hstateen0h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1h', needs rv32i extension
 .*Warning: invalid CSR `hstateen1h', needs `h' extension
-.*Warning: invalid CSR `hstateen1h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1h', needs rv32i extension
 .*Warning: invalid CSR `hstateen1h', needs `h' extension
-.*Warning: invalid CSR `hstateen1h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2h', needs rv32i extension
 .*Warning: invalid CSR `hstateen2h', needs `h' extension
-.*Warning: invalid CSR `hstateen2h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2h', needs rv32i extension
 .*Warning: invalid CSR `hstateen2h', needs `h' extension
-.*Warning: invalid CSR `hstateen2h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3h', needs rv32i extension
 .*Warning: invalid CSR `hstateen3h', needs `h' extension
-.*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3h', needs rv32i extension
 .*Warning: invalid CSR `hstateen3h', needs `h' extension
-.*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3h', needs `ssstateen' extension
 .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
 .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
 .*Warning: read-only CSR is written `csrw scountovf,a1'
diff --git a/gas/testsuite/gas/riscv/csr-version-1p12.l b/gas/testsuite/gas/riscv/csr-version-1p12.l
index cf8f2e25634..c13efcc6681 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p12.l
+++ b/gas/testsuite/gas/riscv/csr-version-1p12.l
@@ -279,30 +279,30 @@
 .*Warning: invalid CSR `mstateen2', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen3', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen3', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen0', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen0', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen1', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen1', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen2', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen2', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen3', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `sstateen0', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen0', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen1', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen1', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen2', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen2', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen3', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0', needs `h' extension
-.*Warning: invalid CSR `hstateen0', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0', needs `h' extension
-.*Warning: invalid CSR `hstateen0', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1', needs `h' extension
-.*Warning: invalid CSR `hstateen1', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1', needs `h' extension
-.*Warning: invalid CSR `hstateen1', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2', needs `h' extension
-.*Warning: invalid CSR `hstateen2', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2', needs `h' extension
-.*Warning: invalid CSR `hstateen2', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3', needs `h' extension
-.*Warning: invalid CSR `hstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3', needs `h' extension
-.*Warning: invalid CSR `hstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `mstateen0h', needs rv32i extension
 .*Warning: invalid CSR `mstateen0h', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen0h', needs rv32i extension
@@ -321,28 +321,28 @@
 .*Warning: invalid CSR `mstateen3h', needs `smstateen' extension
 .*Warning: invalid CSR `hstateen0h', needs rv32i extension
 .*Warning: invalid CSR `hstateen0h', needs `h' extension
-.*Warning: invalid CSR `hstateen0h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0h', needs rv32i extension
 .*Warning: invalid CSR `hstateen0h', needs `h' extension
-.*Warning: invalid CSR `hstateen0h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1h', needs rv32i extension
 .*Warning: invalid CSR `hstateen1h', needs `h' extension
-.*Warning: invalid CSR `hstateen1h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1h', needs rv32i extension
 .*Warning: invalid CSR `hstateen1h', needs `h' extension
-.*Warning: invalid CSR `hstateen1h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2h', needs rv32i extension
 .*Warning: invalid CSR `hstateen2h', needs `h' extension
-.*Warning: invalid CSR `hstateen2h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2h', needs rv32i extension
 .*Warning: invalid CSR `hstateen2h', needs `h' extension
-.*Warning: invalid CSR `hstateen2h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3h', needs rv32i extension
 .*Warning: invalid CSR `hstateen3h', needs `h' extension
-.*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3h', needs rv32i extension
 .*Warning: invalid CSR `hstateen3h', needs `h' extension
-.*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3h', needs `ssstateen' extension
 .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
 .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
 .*Warning: read-only CSR is written `csrw scountovf,a1'
diff --git a/gas/testsuite/gas/riscv/csr-version-1p9p1.l b/gas/testsuite/gas/riscv/csr-version-1p9p1.l
index 5f298c1dda9..bc35630abd0 100644
--- a/gas/testsuite/gas/riscv/csr-version-1p9p1.l
+++ b/gas/testsuite/gas/riscv/csr-version-1p9p1.l
@@ -469,30 +469,30 @@
 .*Warning: invalid CSR `mstateen2', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen3', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen3', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen0', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen0', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen1', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen1', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen2', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen2', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen3', needs `smstateen' extension
-.*Warning: invalid CSR `sstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `sstateen0', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen0', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen1', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen1', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen2', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen2', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen3', needs `ssstateen' extension
+.*Warning: invalid CSR `sstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0', needs `h' extension
-.*Warning: invalid CSR `hstateen0', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0', needs `h' extension
-.*Warning: invalid CSR `hstateen0', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1', needs `h' extension
-.*Warning: invalid CSR `hstateen1', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1', needs `h' extension
-.*Warning: invalid CSR `hstateen1', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2', needs `h' extension
-.*Warning: invalid CSR `hstateen2', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2', needs `h' extension
-.*Warning: invalid CSR `hstateen2', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3', needs `h' extension
-.*Warning: invalid CSR `hstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3', needs `h' extension
-.*Warning: invalid CSR `hstateen3', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3', needs `ssstateen' extension
 .*Warning: invalid CSR `mstateen0h', needs rv32i extension
 .*Warning: invalid CSR `mstateen0h', needs `smstateen' extension
 .*Warning: invalid CSR `mstateen0h', needs rv32i extension
@@ -511,28 +511,28 @@
 .*Warning: invalid CSR `mstateen3h', needs `smstateen' extension
 .*Warning: invalid CSR `hstateen0h', needs rv32i extension
 .*Warning: invalid CSR `hstateen0h', needs `h' extension
-.*Warning: invalid CSR `hstateen0h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen0h', needs rv32i extension
 .*Warning: invalid CSR `hstateen0h', needs `h' extension
-.*Warning: invalid CSR `hstateen0h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen0h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1h', needs rv32i extension
 .*Warning: invalid CSR `hstateen1h', needs `h' extension
-.*Warning: invalid CSR `hstateen1h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen1h', needs rv32i extension
 .*Warning: invalid CSR `hstateen1h', needs `h' extension
-.*Warning: invalid CSR `hstateen1h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen1h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2h', needs rv32i extension
 .*Warning: invalid CSR `hstateen2h', needs `h' extension
-.*Warning: invalid CSR `hstateen2h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen2h', needs rv32i extension
 .*Warning: invalid CSR `hstateen2h', needs `h' extension
-.*Warning: invalid CSR `hstateen2h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen2h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3h', needs rv32i extension
 .*Warning: invalid CSR `hstateen3h', needs `h' extension
-.*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3h', needs `ssstateen' extension
 .*Warning: invalid CSR `hstateen3h', needs rv32i extension
 .*Warning: invalid CSR `hstateen3h', needs `h' extension
-.*Warning: invalid CSR `hstateen3h', needs `smstateen' extension
+.*Warning: invalid CSR `hstateen3h', needs `ssstateen' extension
 .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
 .*Warning: invalid CSR `scountovf', needs `sscofpmf' extension
 .*Warning: read-only CSR is written `csrw scountovf,a1'
diff --git a/gas/testsuite/gas/riscv/csr.s b/gas/testsuite/gas/riscv/csr.s
index 128aeb83a04..397fe0b9eb8 100644
--- a/gas/testsuite/gas/riscv/csr.s
+++ b/gas/testsuite/gas/riscv/csr.s
@@ -337,7 +337,7 @@
 	csr vsip
 	csr vsatp
 
-	# Smstateen extension
+	# Smstateen/Ssstateen extensions
 	csr mstateen0
 	csr mstateen1
 	csr mstateen2
diff --git a/gas/testsuite/gas/riscv/smstateen-csr-s.d b/gas/testsuite/gas/riscv/smstateen-csr-s.d
new file mode 100644
index 00000000000..44b6dd66373
--- /dev/null
+++ b/gas/testsuite/gas/riscv/smstateen-csr-s.d
@@ -0,0 +1,22 @@
+#as: -march=rv32ih_smstateen -mcsr-check -mpriv-spec=1.12
+#source: ssstateen-csr.s
+#objdump: -dr
+
+.*:[ 	]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ 	]+[0-9a-f]+:[ 	]+10c02573[ 	]+csrr[ 	]+a0,sstateen0
+[ 	]+[0-9a-f]+:[ 	]+10d02573[ 	]+csrr[ 	]+a0,sstateen1
+[ 	]+[0-9a-f]+:[ 	]+10e02573[ 	]+csrr[ 	]+a0,sstateen2
+[ 	]+[0-9a-f]+:[ 	]+10f02573[ 	]+csrr[ 	]+a0,sstateen3
+[ 	]+[0-9a-f]+:[ 	]+60c02573[ 	]+csrr[ 	]+a0,hstateen0
+[ 	]+[0-9a-f]+:[ 	]+60d02573[ 	]+csrr[ 	]+a0,hstateen1
+[ 	]+[0-9a-f]+:[ 	]+60e02573[ 	]+csrr[ 	]+a0,hstateen2
+[ 	]+[0-9a-f]+:[ 	]+60f02573[ 	]+csrr[ 	]+a0,hstateen3
+[ 	]+[0-9a-f]+:[ 	]+61c02573[ 	]+csrr[ 	]+a0,hstateen0h
+[ 	]+[0-9a-f]+:[ 	]+61d02573[ 	]+csrr[ 	]+a0,hstateen1h
+[ 	]+[0-9a-f]+:[ 	]+61e02573[ 	]+csrr[ 	]+a0,hstateen2h
+[ 	]+[0-9a-f]+:[ 	]+61f02573[ 	]+csrr[ 	]+a0,hstateen3h
diff --git a/gas/testsuite/gas/riscv/ssstateen-csr.d b/gas/testsuite/gas/riscv/ssstateen-csr.d
new file mode 100644
index 00000000000..29b286a6353
--- /dev/null
+++ b/gas/testsuite/gas/riscv/ssstateen-csr.d
@@ -0,0 +1,22 @@
+#as: -march=rv32ih_ssstateen -mcsr-check -mpriv-spec=1.12
+#source: ssstateen-csr.s
+#objdump: -dr
+
+.*:[ 	]+file format .*
+
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ 	]+[0-9a-f]+:[ 	]+10c02573[ 	]+csrr[ 	]+a0,sstateen0
+[ 	]+[0-9a-f]+:[ 	]+10d02573[ 	]+csrr[ 	]+a0,sstateen1
+[ 	]+[0-9a-f]+:[ 	]+10e02573[ 	]+csrr[ 	]+a0,sstateen2
+[ 	]+[0-9a-f]+:[ 	]+10f02573[ 	]+csrr[ 	]+a0,sstateen3
+[ 	]+[0-9a-f]+:[ 	]+60c02573[ 	]+csrr[ 	]+a0,hstateen0
+[ 	]+[0-9a-f]+:[ 	]+60d02573[ 	]+csrr[ 	]+a0,hstateen1
+[ 	]+[0-9a-f]+:[ 	]+60e02573[ 	]+csrr[ 	]+a0,hstateen2
+[ 	]+[0-9a-f]+:[ 	]+60f02573[ 	]+csrr[ 	]+a0,hstateen3
+[ 	]+[0-9a-f]+:[ 	]+61c02573[ 	]+csrr[ 	]+a0,hstateen0h
+[ 	]+[0-9a-f]+:[ 	]+61d02573[ 	]+csrr[ 	]+a0,hstateen1h
+[ 	]+[0-9a-f]+:[ 	]+61e02573[ 	]+csrr[ 	]+a0,hstateen2h
+[ 	]+[0-9a-f]+:[ 	]+61f02573[ 	]+csrr[ 	]+a0,hstateen3h
diff --git a/gas/testsuite/gas/riscv/ssstateen-csr.s b/gas/testsuite/gas/riscv/ssstateen-csr.s
new file mode 100644
index 00000000000..82707a4625b
--- /dev/null
+++ b/gas/testsuite/gas/riscv/ssstateen-csr.s
@@ -0,0 +1,13 @@
+target:
+	csrr	a0, sstateen0
+	csrr	a0, sstateen1
+	csrr	a0, sstateen2
+	csrr	a0, sstateen3
+	csrr	a0, hstateen0
+	csrr	a0, hstateen1
+	csrr	a0, hstateen2
+	csrr	a0, hstateen3
+	csrr	a0, hstateen0h
+	csrr	a0, hstateen1h
+	csrr	a0, hstateen2h
+	csrr	a0, hstateen3h
diff --git a/include/opcode/riscv-opc.h b/include/opcode/riscv-opc.h
index e40592159cd..982a732bcd2 100644
--- a/include/opcode/riscv-opc.h
+++ b/include/opcode/riscv-opc.h
@@ -3488,27 +3488,27 @@ DECLARE_CSR(vscause, CSR_VSCAUSE, CSR_CLASS_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_C
 DECLARE_CSR(vstval, CSR_VSTVAL, CSR_CLASS_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
 DECLARE_CSR(vsip, CSR_VSIP, CSR_CLASS_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
 DECLARE_CSR(vsatp, CSR_VSATP, CSR_CLASS_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-/* Smstateen extension */
+/* Smstateen/Ssstateen extensions.  */
 DECLARE_CSR(mstateen0, CSR_MSTATEEN0, CSR_CLASS_SMSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
 DECLARE_CSR(mstateen1, CSR_MSTATEEN1, CSR_CLASS_SMSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
 DECLARE_CSR(mstateen2, CSR_MSTATEEN2, CSR_CLASS_SMSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
 DECLARE_CSR(mstateen3, CSR_MSTATEEN3, CSR_CLASS_SMSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(sstateen0, CSR_SSTATEEN0, CSR_CLASS_SMSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(sstateen1, CSR_SSTATEEN1, CSR_CLASS_SMSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(sstateen2, CSR_SSTATEEN2, CSR_CLASS_SMSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(sstateen3, CSR_SSTATEEN3, CSR_CLASS_SMSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(hstateen0, CSR_HSTATEEN0, CSR_CLASS_SMSTATEEN_AND_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(hstateen1, CSR_HSTATEEN1, CSR_CLASS_SMSTATEEN_AND_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(hstateen2, CSR_HSTATEEN2, CSR_CLASS_SMSTATEEN_AND_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(hstateen3, CSR_HSTATEEN3, CSR_CLASS_SMSTATEEN_AND_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(sstateen0, CSR_SSTATEEN0, CSR_CLASS_SSSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(sstateen1, CSR_SSTATEEN1, CSR_CLASS_SSSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(sstateen2, CSR_SSTATEEN2, CSR_CLASS_SSSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(sstateen3, CSR_SSTATEEN3, CSR_CLASS_SSSTATEEN, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(hstateen0, CSR_HSTATEEN0, CSR_CLASS_SSSTATEEN_AND_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(hstateen1, CSR_HSTATEEN1, CSR_CLASS_SSSTATEEN_AND_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(hstateen2, CSR_HSTATEEN2, CSR_CLASS_SSSTATEEN_AND_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(hstateen3, CSR_HSTATEEN3, CSR_CLASS_SSSTATEEN_AND_H, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
 DECLARE_CSR(mstateen0h, CSR_MSTATEEN0H, CSR_CLASS_SMSTATEEN_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
 DECLARE_CSR(mstateen1h, CSR_MSTATEEN1H, CSR_CLASS_SMSTATEEN_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
 DECLARE_CSR(mstateen2h, CSR_MSTATEEN2H, CSR_CLASS_SMSTATEEN_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
 DECLARE_CSR(mstateen3h, CSR_MSTATEEN3H, CSR_CLASS_SMSTATEEN_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(hstateen0h, CSR_HSTATEEN0H, CSR_CLASS_SMSTATEEN_AND_H_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(hstateen1h, CSR_HSTATEEN1H, CSR_CLASS_SMSTATEEN_AND_H_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(hstateen2h, CSR_HSTATEEN2H, CSR_CLASS_SMSTATEEN_AND_H_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-DECLARE_CSR(hstateen3h, CSR_HSTATEEN3H, CSR_CLASS_SMSTATEEN_AND_H_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(hstateen0h, CSR_HSTATEEN0H, CSR_CLASS_SSSTATEEN_AND_H_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(hstateen1h, CSR_HSTATEEN1H, CSR_CLASS_SSSTATEEN_AND_H_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(hstateen2h, CSR_HSTATEEN2H, CSR_CLASS_SSSTATEEN_AND_H_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
+DECLARE_CSR(hstateen3h, CSR_HSTATEEN3H, CSR_CLASS_SSSTATEEN_AND_H_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
 /* Sscofpmf extension */
 DECLARE_CSR(scountovf, CSR_SCOUNTOVF, CSR_CLASS_SSCOFPMF, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
 DECLARE_CSR(mhpmevent3h, CSR_MHPMEVENT3H, CSR_CLASS_SSCOFPMF_32, PRIV_SPEC_CLASS_NONE, PRIV_SPEC_CLASS_NONE)
-- 
2.37.2


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

* [REVIEW ONLY 2/2] NEAR-RATIFICATION RISC-V: Add platform property/capability extensions
  2022-11-03 12:26 [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
  2022-11-03 12:26 ` [REVIEW ONLY 1/2] NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs Tsukasa OI
@ 2022-11-03 12:26 ` Tsukasa OI
  2022-11-03 13:11 ` [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Nelson Chu
  2023-01-30  6:35 ` [PATCH v2 0/1] " Tsukasa OI
  3 siblings, 0 replies; 16+ messages in thread
From: Tsukasa OI @ 2022-11-03 12:26 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

[DO NOT MERGE]
RISC-V Profiles are frozen but -- from my view -- this document will still
change in some way.  Meanwhile, this patch should not be merged upstream.
This commit uses tentative version 1.0 (as there are no versions).

RISC-V Profiles document defines number of "extensions" that indicate
certain platform properties/capabilities just like 'Zkt' extension from the
RISC-V cryptography extensions.

This commit defines 19 platform property/capability extensions as defined
in the RISC-V Profiles documentation.
The version number is tentatively set to 1.0.

The only exception: 'Ssstateen' extension is defined separately because it
defines a subset (supervisor/hypervisor view) of the 'Smstateen' extension.

This is based on the latest version of RISC-V Profiles (version 0.9-draft):
<https://github.com/riscv/riscv-profiles/commit/226b7f643067b29abc6723fac60d5f6d3f9eb901>

[Definition]

"Main memory regions": memory regions with both the cacheability
                       and coherence PMAs.

[New Unprivileged Extensions]

1.  'Ziccif'
    "Main memory regions" support instruction fetch and any instruction
    fetches of naturally aligned power-of-2 sizes up to min(ILEN, XLEN)
    are atomic.
2.  'Ziccrse'
    "Main memory regions" provide the eventual success guarantee for
    LR/SC sequence.
3.  'Ziccamoa'
    "Main memory regions" support all AMO operations including atomic swap,
    logical and arithmetic operations.
4.  'Za64rs'
    For LR/SC instructions, reservation sets are contiguous, naturally
    aligned and at most 64-bytes in size.
5.  'Za128rs'
    Likewise, but reservation sets are at most 128-bytes in size.
6.  'Zicclsm'
    Misaligned loads / stores to "main memory regions" are supported.
    Those include both regular scalar and vector access but does not include
    AMOs and other specialized forms of memory access.
7.  'Zic64b'
    Cache blocks are (exactly) 64-bytes in size and naturally aligned.

[New Privileged Extensions]

1.  'Svbare'
    "satp" mode Bare is supported.
2.  'Ssptead'
    Page-fault exceptions are raised when a page is accessed when A bit is
    clear, or written when D bit is clear.
3.  'Ssccptr'
    "Main memory regions" support hardware page-table reads.
4.  'Sstvecd'
    "stvec" mode Direct is supported.  When "stvec" mode is Direct,
    "stvec.BASE" is capable of holding any valid 4-byte aligned address.
5.  'Sstvala'
    "stval" is always written with a nonzero value whenever possible as
    specified in the Privileged Architecture documentation
    (version 20211203: see section 4.1.9).
6.  'Ssu64xl'
    "sstatus.UXL"=64 [sic].
7.  'Shcounterenw'
    For any "hpmcounter" that is not read-only zero, the corresponding bit
    in "hcounteren" is writable.
8.  'Shvstvala'
    Similar to 'Sstvala' but the same rule applies to "vstval".
9.  'Shtvala'
    "htval" is written with the faulting guest physical address as long as
    permitted by the ISA (a bit similar to 'Sstvala' and 'Shvstvala').
10. 'Shvstvecd'
    Similar to 'Sstvecd' but the same rule applies to "vstvec".
11. 'Shvsatpa'
    All translation modes supported in "satp" are also supported in "vsatp".
12. 'Shgatpa'
    For each supported virtual memory scheme SvNN supported in "satp", the
    corresponding "hgatp" SvNNx4 mode is supported.  The "hgatp" mode Bare
    is also supported.

[Implications]

(Due to reservation set size constraints)
-   'Za64rs' -> 'Za128rs'

(Due to the fact that a privileged "extension" directly refers a CSR)
-   'Svbare'       -> 'Zicsr'
-   'Sstvecd'      -> 'Zicsr'
-   'Sstvala'      -> 'Zicsr'
-   'Ssu64xl'      -> 'Zicsr'

(Due to the fact that a privileged "extension" indirectly depends on CSRs)
-   'Ssptead' -> 'Zicsr'
-   'Ssccptr' -> 'Zicsr'

(Due to the fact that a privileged "extension" is a hypervisor property)
-   'Shcounterenw' -> 'H'
-   'Shvstvala'    -> 'H'
-   'Shtvala'      -> 'H'
-   'Shvstvecd'    -> 'H'
-   'Shvsatpa'     -> 'H'
-   'Shgatpa'      -> 'H'

bfd/ChangeLog:

	* elfxx-riscv.c
	(riscv_implicit_subsets): Add 13 implication rules.
	(riscv_supported_std_z_ext) Add 7 property/capability extensions.
	(riscv_supported_std_s_ext) Add 12 property/capability extensions.
---
 bfd/elfxx-riscv.c | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 781b57cbd98..64811a138a3 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1047,7 +1047,6 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"g", "zicsr",	check_implicit_always},
   {"g", "zifencei",	check_implicit_always},
   {"m", "zmmul",	check_implicit_always},
-  {"h", "zicsr",	check_implicit_always},
   {"q", "d",		check_implicit_always},
   {"v", "d",		check_implicit_always},
   {"v", "zve64d",	check_implicit_always},
@@ -1083,6 +1082,7 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"zhinx", "zhinxmin",	check_implicit_always},
   {"zhinxmin", "zfinx",	check_implicit_always},
   {"zfinx", "zicsr",	check_implicit_always},
+  {"za64rs", "za128rs",	check_implicit_always},
   {"zk", "zkn",		check_implicit_always},
   {"zk", "zkr",		check_implicit_always},
   {"zk", "zkt",		check_implicit_always},
@@ -1099,9 +1099,22 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"zks", "zksh",	check_implicit_always},
   {"smstateen", "ssstateen",	check_implicit_always},
   {"smepmp", "zicsr",		check_implicit_always},
+  {"shcounterenw", "h",		check_implicit_always},
+  {"shgatpa", "h",		check_implicit_always},
+  {"shtvala", "h",		check_implicit_always},
+  {"shvsatpa", "h",		check_implicit_always},
+  {"shvstvala", "h",		check_implicit_always},
+  {"shvstvecd", "h",		check_implicit_always},
+  {"h", "zicsr",		check_implicit_always},
+  {"ssccptr", "zicsr",		check_implicit_always},
   {"sscofpmf", "zicsr",		check_implicit_always},
+  {"ssptead", "zicsr",		check_implicit_always},
   {"ssstateen", "zicsr",	check_implicit_always},
   {"sstc", "zicsr",		check_implicit_always},
+  {"sstvala", "zicsr",		check_implicit_always},
+  {"sstvecd", "zicsr",		check_implicit_always},
+  {"ssu64xl", "zicsr",		check_implicit_always},
+  {"svbare", "zicsr",		check_implicit_always},
   {NULL, NULL, NULL}
 };
 
@@ -1159,6 +1172,11 @@ static struct riscv_supported_ext riscv_supported_std_ext[] =
 
 static struct riscv_supported_ext riscv_supported_std_z_ext[] =
 {
+  {"zic64b",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccamoa",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccif",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"zicclsm",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccrse",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicbom",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicbop",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicboz",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
@@ -1168,6 +1186,8 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
   {"zifencei",		ISA_SPEC_CLASS_20190608,	2, 0,  0 },
   {"zihintpause",	ISA_SPEC_CLASS_DRAFT,		2, 0,  0 },
   {"zmmul",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"za64rs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"za128rs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zawrs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zfh",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zfhmin",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
@@ -1217,11 +1237,23 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
 
 static struct riscv_supported_ext riscv_supported_std_s_ext[] =
 {
+  {"shcounterenw",	ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shgatpa",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shtvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvsatpa",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvstvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvstvecd",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smepmp",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"ssccptr",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"sscofpmf",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"ssptead",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"ssstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"sstc",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"sstvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"sstvecd",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"ssu64xl",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"svbare",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svinval",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svnapot",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svpbmt",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
-- 
2.37.2


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

* Re: [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles
  2022-11-03 12:26 [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
  2022-11-03 12:26 ` [REVIEW ONLY 1/2] NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs Tsukasa OI
  2022-11-03 12:26 ` [REVIEW ONLY 2/2] NEAR-RATIFICATION RISC-V: Add platform property/capability extensions Tsukasa OI
@ 2022-11-03 13:11 ` Nelson Chu
  2022-11-03 13:20   ` Tsukasa OI
  2022-11-19  2:56   ` Tsukasa OI
  2023-01-30  6:35 ` [PATCH v2 0/1] " Tsukasa OI
  3 siblings, 2 replies; 16+ messages in thread
From: Nelson Chu @ 2022-11-03 13:11 UTC (permalink / raw)
  To: Tsukasa OI; +Cc: Kito Cheng, Palmer Dabbelt, binutils

On Thu, Nov 3, 2022 at 8:26 PM Tsukasa OI <research_trasio@irq.a4lg.com> wrote:
>
> Hello,
>
> This patchset implements all extensions from RISC-V Profiles (but not
> profile itself).  I'm not sure whether this patchset helps someone
> implementing RISC-V Profiles but I hope so.
>
> Thanks,
> Tsukasa
>
>
>
>
> Tsukasa OI (2):
>   NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs

Looks good.

>   NEAR-RATIFICATION RISC-V: Add platform property/capability extensions

If we just need to recognize them in assembler, then it looks good.
Thanks for arranging these bunch of extensions before everything gets
messy...  Generally, since they are frozen, we have good reason to
commit them to the mainline.  But if you prefer to wait until they are
ratified, then that's also work to me, I believe you know when will be
the best time, so please commit at that time.

Thanks
Nelson

Nelson

>  bfd/elfxx-riscv.c                           | 38 +++++++++++++++-
>  gas/config/tc-riscv.c                       | 20 +++++----
>  gas/testsuite/gas/riscv/csr-version-1p10.l  | 48 ++++++++++-----------
>  gas/testsuite/gas/riscv/csr-version-1p11.l  | 48 ++++++++++-----------
>  gas/testsuite/gas/riscv/csr-version-1p12.l  | 48 ++++++++++-----------
>  gas/testsuite/gas/riscv/csr-version-1p9p1.l | 48 ++++++++++-----------
>  gas/testsuite/gas/riscv/csr.s               |  2 +-
>  gas/testsuite/gas/riscv/smstateen-csr-s.d   | 22 ++++++++++
>  gas/testsuite/gas/riscv/ssstateen-csr.d     | 22 ++++++++++
>  gas/testsuite/gas/riscv/ssstateen-csr.s     | 13 ++++++
>  include/opcode/riscv-opc.h                  | 26 +++++------
>  11 files changed, 215 insertions(+), 120 deletions(-)
>  create mode 100644 gas/testsuite/gas/riscv/smstateen-csr-s.d
>  create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.d
>  create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.s
>
>
> base-commit: ae1c45ead6b60ef0fd338bbeb6a4c5e5808c6e6a
> --
> 2.37.2
>

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

* Re: [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles
  2022-11-03 13:11 ` [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Nelson Chu
@ 2022-11-03 13:20   ` Tsukasa OI
  2022-11-19  2:56   ` Tsukasa OI
  1 sibling, 0 replies; 16+ messages in thread
From: Tsukasa OI @ 2022-11-03 13:20 UTC (permalink / raw)
  To: Nelson Chu; +Cc: binutils

On 2022/11/03 22:11, Nelson Chu wrote:
> On Thu, Nov 3, 2022 at 8:26 PM Tsukasa OI <research_trasio@irq.a4lg.com> wrote:
>>
>> Hello,
>>
>> This patchset implements all extensions from RISC-V Profiles (but not
>> profile itself).  I'm not sure whether this patchset helps someone
>> implementing RISC-V Profiles but I hope so.
>>
>> Thanks,
>> Tsukasa
>>
>>
>>
>>
>> Tsukasa OI (2):
>>   NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs
> 
> Looks good.
> 
>>   NEAR-RATIFICATION RISC-V: Add platform property/capability extensions
> 
> If we just need to recognize them in assembler, then it looks good.
> Thanks for arranging these bunch of extensions before everything gets
> messy...  Generally, since they are frozen, we have good reason to
> commit them to the mainline.  But if you prefer to wait until they are
> ratified, then that's also work to me, I believe you know when will be
> the best time, so please commit at that time.

Thanks for the review!

I want to clarify that whether those names are actually extensions and I
just pushed a pull request for this (related to PATCH 2/2):
<https://github.com/riscv/riscv-profiles/pull/76>

I will push this depending on the resolution of this pull request.

Thanks,
Tsukasa

> 
> Thanks
> Nelson
> 
> Nelson
> 
>>  bfd/elfxx-riscv.c                           | 38 +++++++++++++++-
>>  gas/config/tc-riscv.c                       | 20 +++++----
>>  gas/testsuite/gas/riscv/csr-version-1p10.l  | 48 ++++++++++-----------
>>  gas/testsuite/gas/riscv/csr-version-1p11.l  | 48 ++++++++++-----------
>>  gas/testsuite/gas/riscv/csr-version-1p12.l  | 48 ++++++++++-----------
>>  gas/testsuite/gas/riscv/csr-version-1p9p1.l | 48 ++++++++++-----------
>>  gas/testsuite/gas/riscv/csr.s               |  2 +-
>>  gas/testsuite/gas/riscv/smstateen-csr-s.d   | 22 ++++++++++
>>  gas/testsuite/gas/riscv/ssstateen-csr.d     | 22 ++++++++++
>>  gas/testsuite/gas/riscv/ssstateen-csr.s     | 13 ++++++
>>  include/opcode/riscv-opc.h                  | 26 +++++------
>>  11 files changed, 215 insertions(+), 120 deletions(-)
>>  create mode 100644 gas/testsuite/gas/riscv/smstateen-csr-s.d
>>  create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.d
>>  create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.s
>>
>>
>> base-commit: ae1c45ead6b60ef0fd338bbeb6a4c5e5808c6e6a
>> --
>> 2.37.2
>>
> 

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

* Re: [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles
  2022-11-03 13:11 ` [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Nelson Chu
  2022-11-03 13:20   ` Tsukasa OI
@ 2022-11-19  2:56   ` Tsukasa OI
  1 sibling, 0 replies; 16+ messages in thread
From: Tsukasa OI @ 2022-11-19  2:56 UTC (permalink / raw)
  To: Nelson Chu; +Cc: binutils

On 2022/11/03 22:11, Nelson Chu wrote:
> On Thu, Nov 3, 2022 at 8:26 PM Tsukasa OI <research_trasio@irq.a4lg.com> wrote:
>>
>> Hello,
>>
>> This patchset implements all extensions from RISC-V Profiles (but not
>> profile itself).  I'm not sure whether this patchset helps someone
>> implementing RISC-V Profiles but I hope so.
>>
>> Thanks,
>> Tsukasa
>>
>>
>>
>>
>> Tsukasa OI (2):
>>   NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs
> 
> Looks good.

I will commit this (PATCH 1/2) soon.

> 
>>   NEAR-RATIFICATION RISC-V: Add platform property/capability extensions
> 
> If we just need to recognize them in assembler, then it looks good.
> Thanks for arranging these bunch of extensions before everything gets
> messy...  Generally, since they are frozen, we have good reason to
> commit them to the mainline.  But if you prefer to wait until they are
> ratified, then that's also work to me, I believe you know when will be
> the best time, so please commit at that time.

Some pointed out that an extension name 'Ssptead' is no good:
https://github.com/riscv/riscv-profiles/issues/81

New name would be 'Svptead'?  In any case, I'll wait PATCH 2/2 until...
at least this issue is resolved in the main branch in some way.

Thanks,
Tsukasa

> 
> Thanks
> Nelson
> 
> Nelson
> 
>>  bfd/elfxx-riscv.c                           | 38 +++++++++++++++-
>>  gas/config/tc-riscv.c                       | 20 +++++----
>>  gas/testsuite/gas/riscv/csr-version-1p10.l  | 48 ++++++++++-----------
>>  gas/testsuite/gas/riscv/csr-version-1p11.l  | 48 ++++++++++-----------
>>  gas/testsuite/gas/riscv/csr-version-1p12.l  | 48 ++++++++++-----------
>>  gas/testsuite/gas/riscv/csr-version-1p9p1.l | 48 ++++++++++-----------
>>  gas/testsuite/gas/riscv/csr.s               |  2 +-
>>  gas/testsuite/gas/riscv/smstateen-csr-s.d   | 22 ++++++++++
>>  gas/testsuite/gas/riscv/ssstateen-csr.d     | 22 ++++++++++
>>  gas/testsuite/gas/riscv/ssstateen-csr.s     | 13 ++++++
>>  include/opcode/riscv-opc.h                  | 26 +++++------
>>  11 files changed, 215 insertions(+), 120 deletions(-)
>>  create mode 100644 gas/testsuite/gas/riscv/smstateen-csr-s.d
>>  create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.d
>>  create mode 100644 gas/testsuite/gas/riscv/ssstateen-csr.s
>>
>>
>> base-commit: ae1c45ead6b60ef0fd338bbeb6a4c5e5808c6e6a
>> --
>> 2.37.2
>>
> 

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

* [PATCH v2 0/1] RISC-V: Extensions from the RISC-V Profiles
  2022-11-03 12:26 [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
                   ` (2 preceding siblings ...)
  2022-11-03 13:11 ` [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Nelson Chu
@ 2023-01-30  6:35 ` Tsukasa OI
  2023-01-30  6:35   ` [PATCH v2 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
                     ` (2 more replies)
  3 siblings, 3 replies; 16+ messages in thread
From: Tsukasa OI @ 2023-01-30  6:35 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

Hello,

First, to whom concerned (especially, to Nelson):
I quit the job two weeks ago due to my poor health conditions and will take
some time for recuperation.  Because of this (despite that I've seen all
your reviews and responses), I will not be able to respond properly (and in
a responsible manner) until... probably April or May.


Before I get busier, I will submit this one because the RISC-V Profiles
documentation is now updated (version 0.9.2, the release for TSC
recommendation to ratify) and this time, it's very unlikely to change now
(I found a typo in this but at least it's stable enough to implement).

c.f. <https://github.com/riscv/riscv-profiles/releases/tag/v0.9.2>

On PATCH v1, though the base specification (version 0.9-draft) was Frozen,
some changes are expected and I submitted it with DO NOT MERGE status.

The change actually happened and an extension name has changed ('Ssptead' ->
'Svptead' -> 'Svade').  This time, I think it's safe to upstream new
extension names.


Sincerely,
Tsukasa




Tsukasa OI (1):
  RISC-V: Add platform property/capability extensions

 bfd/elfxx-riscv.c | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)


base-commit: 594a01c217143dce2f1f3181bcca4047b4a44107
-- 
2.39.0


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

* [PATCH v2 1/1] RISC-V: Add platform property/capability extensions
  2023-01-30  6:35 ` [PATCH v2 0/1] " Tsukasa OI
@ 2023-01-30  6:35   ` Tsukasa OI
  2023-01-30  7:11   ` [PATCH v3 0/1] RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
  2023-01-31  4:46   ` [PATCH v2 0/1] RISC-V: Extensions from the RISC-V Profiles Nelson Chu
  2 siblings, 0 replies; 16+ messages in thread
From: Tsukasa OI @ 2023-01-30  6:35 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

From: Tsukasa OI <research_trasio@irq.a4lg.com>

RISC-V Profiles document defines number of "extensions" that indicate
certain platform properties/capabilities just like 'Zkt' extension from the
RISC-V cryptography extensions.

This commit defines 19 platform property/capability extensions as defined
in the RISC-V Profiles documentation.
The version number is set to 1.0.

The only exception: 'Ssstateen' extension is defined separately because it
defines a subset (supervisor/hypervisor view) of the 'Smstateen' extension.

This is based on the latest version of RISC-V Profiles (version 0.9.2,
the release for TSC recommendation to ratify):
<https://github.com/riscv/riscv-profiles/releases/tag/v0.9.2>

[Definition]

"Main memory regions":
    Main memory regions (in contrast to I/O or vacant memory regions) with
    both the cacheability and coherence PMAs.

[New Unprivileged Extensions]

1.  'Ziccif'
    "Main memory regions" support instruction fetch and any instruction
    fetches of naturally aligned power-of-2 sizes up to min(ILEN, XLEN)
    are atomic.
2.  'Ziccrse'
    "Main memory regions" provide the eventual success guarantee for
    LR/SC sequence (RsrvEventual).
3.  'Ziccamoa'
    "Main memory regions" support all currently-defined AMO operations
    including swap, logical and arithmetic operations (AMOArithmetic).
4.  'Za64rs'
    For LR/SC instructions, reservation sets are contiguous, naturally
    aligned and at most 64-bytes in size.
5.  'Za128rs'
    Likewise, but reservation sets are at most 128-bytes in size.
6.  'Zicclsm'
    Misaligned loads / stores to "main memory regions" are supported.
    Those include both regular scalar and vector accesses but does not
    include AMOs and other specialized forms of memory access.
7.  'Zic64b'
    Cache blocks are (exactly) 64-bytes in size and naturally aligned.

[New Privileged Extensions]

1.  'Svbare'
    "satp" mode Bare is supported.
2.  'Svade'
    Page-fault exceptions are raised when a page is accessed when A bit is
    clear, or written when D bit is clear.
3.  'Ssccptr'
    "Main memory regions" support hardware page-table reads.
4.  'Sstvecd'
    "stvec" mode Direct is supported.  When "stvec" mode is Direct,
    "stvec.BASE" is capable of holding any valid 4-byte aligned address.
5.  'Sstvala'
    "stval" is always written with a nonzero value whenever possible as
    specified in the Privileged Architecture documentation
    (version 20211203: see section 4.1.9).
6.  'Ssu64xl'
    "sstatus.UXL" is capable of holding the value 0b10
    (UXLEN==64 is supported).
7.  'Shcounterenw'
    For any "hpmcounter" that is not read-only zero, the corresponding bit
    in "hcounteren" is writable.
8.  'Shvstvala'
    Similar to 'Sstvala' but the same rule applies to "vstval".
9.  'Shtvala'
    "htval" is written with the faulting guest physical address as long as
    permitted by the ISA (a bit similar to 'Sstvala' and 'Shvstvala').
10. 'Shvstvecd'
    Similar to 'Sstvecd' but the same rule applies to "vstvec".
11. 'Shvsatpa'
    All translation modes supported in "satp" are also supported in "vsatp".
12. 'Shgatpa'
    For each supported virtual memory scheme SvNN supported in "satp", the
    corresponding "hgatp" SvNNx4 mode is supported.  The "hgatp" mode Bare
    is also supported.

[Implications]

(Due to reservation set size constraints)
-   'Za64rs' -> 'Za128rs'

(Due to the fact that a privileged "extension" directly refers a CSR)
-   'Svbare'       -> 'Zicsr'
-   'Sstvecd'      -> 'Zicsr'
-   'Sstvala'      -> 'Zicsr'
-   'Ssu64xl'      -> 'Zicsr'

(Due to the fact that a privileged "extension" indirectly depends on CSRs)
-   'Svade' -> 'Zicsr'

(Due to the fact that a privileged "extension" is a hypervisor property)
-   'Shcounterenw' -> 'H'
-   'Shvstvala'    -> 'H'
-   'Shtvala'      -> 'H'
-   'Shvstvecd'    -> 'H'
-   'Shvsatpa'     -> 'H'
-   'Shgatpa'      -> 'H'

bfd/ChangeLog:

	* elfxx-riscv.c
	(riscv_implicit_subsets): Add 12 implication rules.
	(riscv_supported_std_z_ext) Add 7 property/capability extensions.
	(riscv_supported_std_s_ext) Add 12 property/capability extensions.
---
 bfd/elfxx-riscv.c | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 19391d94e305..6d1c913fb183 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1051,7 +1051,6 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"g", "zicsr",	check_implicit_always},
   {"g", "zifencei",	check_implicit_always},
   {"m", "zmmul",	check_implicit_always},
-  {"h", "zicsr",	check_implicit_always},
   {"q", "d",		check_implicit_always},
   {"v", "d",		check_implicit_always},
   {"v", "zve64d",	check_implicit_always},
@@ -1087,6 +1086,7 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"zhinx", "zhinxmin",	check_implicit_always},
   {"zhinxmin", "zfinx",	check_implicit_always},
   {"zfinx", "zicsr",	check_implicit_always},
+  {"za64rs", "za128rs",	check_implicit_always},
   {"zk", "zkn",		check_implicit_always},
   {"zk", "zkr",		check_implicit_always},
   {"zk", "zkt",		check_implicit_always},
@@ -1104,10 +1104,22 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"smaia", "ssaia",		check_implicit_always},
   {"smstateen", "ssstateen",	check_implicit_always},
   {"smepmp", "zicsr",		check_implicit_always},
+  {"shcounterenw", "h",		check_implicit_always},
+  {"shgatpa", "h",		check_implicit_always},
+  {"shtvala", "h",		check_implicit_always},
+  {"shvsatpa", "h",		check_implicit_always},
+  {"shvstvala", "h",		check_implicit_always},
+  {"shvstvecd", "h",		check_implicit_always},
+  {"h", "zicsr",		check_implicit_always},
   {"ssaia", "zicsr",		check_implicit_always},
   {"sscofpmf", "zicsr",		check_implicit_always},
   {"ssstateen", "zicsr",	check_implicit_always},
   {"sstc", "zicsr",		check_implicit_always},
+  {"sstvala", "zicsr",		check_implicit_always},
+  {"sstvecd", "zicsr",		check_implicit_always},
+  {"ssu64xl", "zicsr",		check_implicit_always},
+  {"svade", "zicsr",		check_implicit_always},
+  {"svbare", "zicsr",		check_implicit_always},
   {NULL, NULL, NULL}
 };
 
@@ -1165,6 +1177,11 @@ static struct riscv_supported_ext riscv_supported_std_ext[] =
 
 static struct riscv_supported_ext riscv_supported_std_z_ext[] =
 {
+  {"zic64b",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccamoa",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccif",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"zicclsm",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccrse",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicbom",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicbop",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicboz",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
@@ -1174,6 +1191,8 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
   {"zifencei",		ISA_SPEC_CLASS_20190608,	2, 0,  0 },
   {"zihintpause",	ISA_SPEC_CLASS_DRAFT,		2, 0,  0 },
   {"zmmul",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"za64rs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"za128rs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zawrs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zfh",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zfhmin",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
@@ -1227,11 +1246,25 @@ static struct riscv_supported_ext riscv_supported_std_s_ext[] =
   {"smepmp",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"ssaia",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shcounterenw",	ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shgatpa",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shtvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvsatpa",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvstvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvstvecd",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"smepmp",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"smstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"ssccptr",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"sscofpmf",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"ssstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"sstc",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"sstvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"sstvecd",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"ssu64xl",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"svbare",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svinval",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svnapot",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"svade",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svpbmt",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {NULL, 0, 0, 0, 0}
 };
-- 
2.39.0


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

* [PATCH v3 0/1] RISC-V: Extensions from the RISC-V Profiles
  2023-01-30  6:35 ` [PATCH v2 0/1] " Tsukasa OI
  2023-01-30  6:35   ` [PATCH v2 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
@ 2023-01-30  7:11   ` Tsukasa OI
  2023-01-30  7:11     ` [PATCH v3 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
  2023-07-26  0:05     ` [PATCH v4 0/1] RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
  2023-01-31  4:46   ` [PATCH v2 0/1] RISC-V: Extensions from the RISC-V Profiles Nelson Chu
  2 siblings, 2 replies; 16+ messages in thread
From: Tsukasa OI @ 2023-01-30  7:11 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

Oops, PATCH v2 has some minor mistakes.

[Changes: v2 -> v3]

1.  After AIA is upstreamed, I haven't done tidying up with
    riscv_supported_std_s_ext with my rebased branch.  That made location of
    'Ssaia' a bit out of place. PATCH v3 fixes this.
2.  After version 0.8, the new extension 'Sscounterenw' is added but I
    missed that.  PATCH v3 adds support for this new extension correctly.
3.  I made minor changes to ChangeLog part of the commit message
    (I moved 'H' -> 'Zicsr' dependency for a reason but I didn't mentioned
    in the ChangeLog).

Thanks,
Tsukasa




Tsukasa OI (1):
  RISC-V: Add platform property/capability extensions

 bfd/elfxx-riscv.c | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)


base-commit: 594a01c217143dce2f1f3181bcca4047b4a44107
-- 
2.39.1


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

* [PATCH v3 1/1] RISC-V: Add platform property/capability extensions
  2023-01-30  7:11   ` [PATCH v3 0/1] RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
@ 2023-01-30  7:11     ` Tsukasa OI
  2023-07-26  0:05     ` [PATCH v4 0/1] RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
  1 sibling, 0 replies; 16+ messages in thread
From: Tsukasa OI @ 2023-01-30  7:11 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

From: Tsukasa OI <research_trasio@irq.a4lg.com>

RISC-V Profiles document defines number of "extensions" that indicate
certain platform properties/capabilities just like 'Zkt' extension from the
RISC-V cryptography extensions.

This commit defines 20 platform property/capability extensions as defined
in the RISC-V Profiles documentation.
The version number is set to 1.0.

The only exception: 'Ssstateen' extension is defined separately because it
defines a subset (supervisor/hypervisor view) of the 'Smstateen' extension.

This is based on the latest version of RISC-V Profiles (version 0.9.2,
the release for TSC recommendation to ratify):
<https://github.com/riscv/riscv-profiles/releases/tag/v0.9.2>

[Definition]

"Main memory regions":
    Main memory regions (in contrast to I/O or vacant memory regions) with
    both the cacheability and coherence PMAs.

[New Unprivileged Extensions]

1.  'Ziccif'
    "Main memory regions" support instruction fetch and any instruction
    fetches of naturally aligned power-of-2 sizes up to min(ILEN, XLEN)
    are atomic.
2.  'Ziccrse'
    "Main memory regions" provide the eventual success guarantee for
    LR/SC sequence (RsrvEventual).
3.  'Ziccamoa'
    "Main memory regions" support all currently-defined AMO operations
    including swap, logical and arithmetic operations (AMOArithmetic).
4.  'Za64rs'
    For LR/SC instructions, reservation sets are contiguous, naturally
    aligned and at most 64-bytes in size.
5.  'Za128rs'
    Likewise, but reservation sets are at most 128-bytes in size.
6.  'Zicclsm'
    Misaligned loads / stores to "main memory regions" are supported.
    Those include both regular scalar and vector accesses but does not
    include AMOs and other specialized forms of memory access.
7.  'Zic64b'
    Cache blocks are (exactly) 64-bytes in size and naturally aligned.

[New Privileged Extensions]

1.  'Svbare'
    "satp" mode Bare is supported.
2.  'Svade'
    Page-fault exceptions are raised when a page is accessed when A bit is
    clear, or written when D bit is clear.
3.  'Ssccptr'
    "Main memory regions" support hardware page-table reads.
4.  'Sstvecd'
    "stvec" mode Direct is supported.  When "stvec" mode is Direct,
    "stvec.BASE" is capable of holding any valid 4-byte aligned address.
5.  'Sstvala'
    "stval" is always written with a nonzero value whenever possible as
    specified in the Privileged Architecture documentation
    (version 20211203: see section 4.1.9).
6.  'Sscounterenw'
    For any "hpmcounter" that is not read-only zero, the corresponding bit
    in "scounteren" is writable.
7.  'Ssu64xl'
    "sstatus.UXL" is capable of holding the value 0b10
    (UXLEN==64 is supported).
8.  'Shcounterenw'
    For any "hpmcounter" that is not read-only zero, the corresponding bit
    in "hcounteren" is writable.
9.  'Shvstvala'
    Similar to 'Sstvala' but the same rule applies to "vstval".
10. 'Shtvala'
    "htval" is written with the faulting guest physical address as long as
    permitted by the ISA (a bit similar to 'Sstvala' and 'Shvstvala').
11. 'Shvstvecd'
    Similar to 'Sstvecd' but the same rule applies to "vstvec".
12. 'Shvsatpa'
    All translation modes supported in "satp" are also supported in "vsatp".
13. 'Shgatpa'
    For each supported virtual memory scheme SvNN supported in "satp", the
    corresponding "hgatp" SvNNx4 mode is supported.  The "hgatp" mode Bare
    is also supported.

[Implications]

(Due to reservation set size constraints)
-   'Za64rs' -> 'Za128rs'

(Due to the fact that a privileged "extension" directly refers a CSR)
-   'Svbare'       -> 'Zicsr'
-   'Sstvecd'      -> 'Zicsr'
-   'Sstvala'      -> 'Zicsr'
-   'Sscounterenw' -> 'Zicsr'
-   'Ssu64xl'      -> 'Zicsr'

(Due to the fact that a privileged "extension" indirectly depends on CSRs)
-   'Svade' -> 'Zicsr'

(Due to the fact that a privileged "extension" is a hypervisor property)
-   'Shcounterenw' -> 'H'
-   'Shvstvala'    -> 'H'
-   'Shtvala'      -> 'H'
-   'Shvstvecd'    -> 'H'
-   'Shvsatpa'     -> 'H'
-   'Shgatpa'      -> 'H'

bfd/ChangeLog:

	* elfxx-riscv.c
	(riscv_implicit_subsets): Add 13 implication rules.
	Reorder 'H' for new 'Sh*' extensions.
	(riscv_supported_std_z_ext) Add 7 property/capability extensions.
	(riscv_supported_std_s_ext) Add 13 property/capability extensions.
---
 bfd/elfxx-riscv.c | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 19391d94e305..19aa9f9ef74f 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1051,7 +1051,6 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"g", "zicsr",	check_implicit_always},
   {"g", "zifencei",	check_implicit_always},
   {"m", "zmmul",	check_implicit_always},
-  {"h", "zicsr",	check_implicit_always},
   {"q", "d",		check_implicit_always},
   {"v", "d",		check_implicit_always},
   {"v", "zve64d",	check_implicit_always},
@@ -1087,6 +1086,7 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"zhinx", "zhinxmin",	check_implicit_always},
   {"zhinxmin", "zfinx",	check_implicit_always},
   {"zfinx", "zicsr",	check_implicit_always},
+  {"za64rs", "za128rs",	check_implicit_always},
   {"zk", "zkn",		check_implicit_always},
   {"zk", "zkr",		check_implicit_always},
   {"zk", "zkt",		check_implicit_always},
@@ -1104,10 +1104,23 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"smaia", "ssaia",		check_implicit_always},
   {"smstateen", "ssstateen",	check_implicit_always},
   {"smepmp", "zicsr",		check_implicit_always},
+  {"shcounterenw", "h",		check_implicit_always},
+  {"shgatpa", "h",		check_implicit_always},
+  {"shtvala", "h",		check_implicit_always},
+  {"shvsatpa", "h",		check_implicit_always},
+  {"shvstvala", "h",		check_implicit_always},
+  {"shvstvecd", "h",		check_implicit_always},
+  {"h", "zicsr",		check_implicit_always},
   {"ssaia", "zicsr",		check_implicit_always},
   {"sscofpmf", "zicsr",		check_implicit_always},
+  {"sscounterenw", "zicsr",	check_implicit_always},
   {"ssstateen", "zicsr",	check_implicit_always},
   {"sstc", "zicsr",		check_implicit_always},
+  {"sstvala", "zicsr",		check_implicit_always},
+  {"sstvecd", "zicsr",		check_implicit_always},
+  {"ssu64xl", "zicsr",		check_implicit_always},
+  {"svade", "zicsr",		check_implicit_always},
+  {"svbare", "zicsr",		check_implicit_always},
   {NULL, NULL, NULL}
 };
 
@@ -1165,6 +1178,11 @@ static struct riscv_supported_ext riscv_supported_std_ext[] =
 
 static struct riscv_supported_ext riscv_supported_std_z_ext[] =
 {
+  {"zic64b",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccamoa",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccif",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"zicclsm",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccrse",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicbom",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicbop",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicboz",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
@@ -1174,6 +1192,8 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
   {"zifencei",		ISA_SPEC_CLASS_20190608,	2, 0,  0 },
   {"zihintpause",	ISA_SPEC_CLASS_DRAFT,		2, 0,  0 },
   {"zmmul",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"za64rs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"za128rs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zawrs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zfh",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zfhmin",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
@@ -1226,12 +1246,27 @@ static struct riscv_supported_ext riscv_supported_std_s_ext[] =
   {"smaia",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smepmp",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shcounterenw",	ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shgatpa",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shtvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvsatpa",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvstvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvstvecd",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"smepmp",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"smstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"ssaia",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"ssccptr",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"sscofpmf",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"sscounterenw",	ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"ssstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"sstc",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"sstvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"sstvecd",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"ssu64xl",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"svbare",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svinval",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svnapot",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"svade",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svpbmt",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {NULL, 0, 0, 0, 0}
 };
-- 
2.39.1


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

* Re: [PATCH v2 0/1] RISC-V: Extensions from the RISC-V Profiles
  2023-01-30  6:35 ` [PATCH v2 0/1] " Tsukasa OI
  2023-01-30  6:35   ` [PATCH v2 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
  2023-01-30  7:11   ` [PATCH v3 0/1] RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
@ 2023-01-31  4:46   ` Nelson Chu
  2 siblings, 0 replies; 16+ messages in thread
From: Nelson Chu @ 2023-01-31  4:46 UTC (permalink / raw)
  To: Tsukasa OI; +Cc: Kito Cheng, Palmer Dabbelt, binutils

On Mon, Jan 30, 2023 at 2:35 PM Tsukasa OI <research_trasio@irq.a4lg.com> wrote:
>
> Hello,
>
> First, to whom concerned (especially, to Nelson):
> I quit the job two weeks ago due to my poor health conditions and will take
> some time for recuperation.  Because of this (despite that I've seen all
> your reviews and responses), I will not be able to respond properly (and in
> a responsible manner) until... probably April or May.

For me at least, I believe health and family are definitely top of
mind, so even though this news is certainly a loss for the entire
risc-v community, especially for the GNU developers and me, I still
hope that you can take this time to recover just like before.  Don't
pay too much attention to what I thought at that time, since people
always change their mind and become better with time :-)  The only
thing that won't change is everyone here wants to make upstream
better, that definitely includes you and me.  So thanks for all your
contributions and efforts before.  Take care, stay safe, looking
forward to co-work with you soon, no matter what field and what times.

Nelson

> Before I get busier, I will submit this one because the RISC-V Profiles
> documentation is now updated (version 0.9.2, the release for TSC
> recommendation to ratify) and this time, it's very unlikely to change now
> (I found a typo in this but at least it's stable enough to implement).
>
> c.f. <https://github.com/riscv/riscv-profiles/releases/tag/v0.9.2>
>
> On PATCH v1, though the base specification (version 0.9-draft) was Frozen,
> some changes are expected and I submitted it with DO NOT MERGE status.
>
> The change actually happened and an extension name has changed ('Ssptead' ->
> 'Svptead' -> 'Svade').  This time, I think it's safe to upstream new
> extension names.

Thanks, I will take a look at this later :)

>
> Sincerely,
> Tsukasa
>
>
>
>
> Tsukasa OI (1):
>   RISC-V: Add platform property/capability extensions
>
>  bfd/elfxx-riscv.c | 35 ++++++++++++++++++++++++++++++++++-
>  1 file changed, 34 insertions(+), 1 deletion(-)
>
>
> base-commit: 594a01c217143dce2f1f3181bcca4047b4a44107
> --
> 2.39.0
>

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

* [PATCH v4 0/1] RISC-V: Extensions from the RISC-V Profiles
  2023-01-30  7:11   ` [PATCH v3 0/1] RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
  2023-01-30  7:11     ` [PATCH v3 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
@ 2023-07-26  0:05     ` Tsukasa OI
  2023-07-26  0:05       ` [PATCH v4 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
  1 sibling, 1 reply; 16+ messages in thread
From: Tsukasa OI @ 2023-07-26  0:05 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

This patch (set) adds 7 unprivileged extensions and 13 privileged
extensions, all of which denotes certain platform capability / constraint.

This is almost a resend of the previous PATCH v3 (in January 2023) but since
the RISC-V Profiles specification is now ratified, it's much safer to merge.

[Changes: v2 -> v3]

1.  After AIA is upstreamed, I haven't done tidying up with
    riscv_supported_std_s_ext with my rebased branch.  That made location of
    'Ssaia' a bit out of place. PATCH v3 fixes this.
2.  After version 0.8, the new extension 'Sscounterenw' is added but I
    missed that.  PATCH v3 adds support for this new extension correctly.
3.  I made minor changes to ChangeLog part of the commit message
    (I moved 'H' -> 'Zicsr' dependency for a reason but I didn't mentioned
    in the ChangeLog).

[Changes: v3 -> v4]

1.  Rebase against the latest master (with a bit of reordering).
2.  Reorder renamed 'Svade' to reflect canonical order.
3.  Referenced specification is now the ratified one (version 1.0),
    not frozen but draft one (version 0.9.2).

Thanks,
Tsukasa




Tsukasa OI (1):
  RISC-V: Add platform property/capability extensions

 bfd/elfxx-riscv.c | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)


base-commit: 6296109afcd8c8e89b771fbaf092d17a17d4ea99
-- 
2.41.0


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

* [PATCH v4 1/1] RISC-V: Add platform property/capability extensions
  2023-07-26  0:05     ` [PATCH v4 0/1] RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
@ 2023-07-26  0:05       ` Tsukasa OI
  2023-07-26  0:47         ` Palmer Dabbelt
  0 siblings, 1 reply; 16+ messages in thread
From: Tsukasa OI @ 2023-07-26  0:05 UTC (permalink / raw)
  To: Tsukasa OI, Nelson Chu, Kito Cheng, Palmer Dabbelt; +Cc: binutils

From: Tsukasa OI <research_trasio@irq.a4lg.com>

RISC-V Profiles document defines number of "extensions" that indicate
certain platform properties/capabilities just like 'Zkt' extension from the
RISC-V cryptography extensions.

This commit defines 20 platform property/capability extensions as defined
in the RISC-V Profiles documentation.

The only exception: 'Ssstateen' extension is defined separately because it
defines a subset (supervisor/hypervisor view) of the 'Smstateen' extension.

This is based on the ratified version of RISC-V Profiles:
<https://github.com/riscv/riscv-profiles/releases/tag/v1.0>

[Definition]

"Main memory regions":
    Main memory regions (in contrast to I/O or vacant memory regions) with
    both the cacheability and coherence PMAs.

[New Unprivileged Extensions]

1.  'Ziccif'
    "Main memory regions" support instruction fetch and any instruction
    fetches of naturally aligned power-of-2 sizes up to min(ILEN, XLEN)
    are atomic.
2.  'Ziccrse'
    "Main memory regions" provide the eventual success guarantee for
    LR/SC sequence (RsrvEventual).
3.  'Ziccamoa'
    "Main memory regions" support all currently-defined AMO operations
    including swap, logical and arithmetic operations (AMOArithmetic).
4.  'Za64rs'
    For LR/SC instructions, reservation sets are contiguous, naturally
    aligned and at most 64-bytes in size.
5.  'Za128rs'
    Likewise, but reservation sets are at most 128-bytes in size.
6.  'Zicclsm'
    Misaligned loads / stores to "main memory regions" are supported.
    Those include both regular scalar and vector accesses but does not
    include AMOs and other specialized forms of memory accesses.
7.  'Zic64b'
    Cache blocks are (exactly) 64-bytes in size and naturally aligned.

[New Privileged Extensions]

1.  'Svbare'
    "satp" mode Bare is supported.
2.  'Svade'
    Page-fault exceptions are raised when a page is accessed when A bit is
    clear, or written when D bit is clear.
3.  'Ssccptr'
    "Main memory regions" support hardware page-table reads.
4.  'Sstvecd'
    "stvec" mode Direct is supported.  When "stvec" mode is Direct,
    "stvec.BASE" is capable of holding any valid 4-byte aligned address.
5.  'Sstvala'
    "stval" is always written with a nonzero value whenever possible as
    specified in the Privileged Architecture documentation
    (version 20211203: see section 4.1.9).
6.  'Sscounterenw'
    For any "hpmcounter" that is not read-only zero, the corresponding bit
    in "scounteren" is writable.
7.  'Ssu64xl'
    "sstatus.UXL" is capable of holding the value 0b10
    (UXLEN==64 is supported).
8.  'Shcounterenw'
    Similar to 'Sscounterenw' but the same rule applies to "hcounteren".
9.  'Shvstvala'
    Similar to 'Sstvala' but the same rule applies to "vstval".
10. 'Shtvala'
    "htval" is written with the faulting guest physical address as long as
    permitted by the ISA (a bit similar to 'Sstvala' and 'Shvstvala').
11. 'Shvstvecd'
    Similar to 'Sstvecd' but the same rule applies to "vstvec".
12. 'Shvsatpa'
    All translation modes supported in "satp" are also supported in "vsatp".
13. 'Shgatpa'
    For each supported virtual memory scheme SvNN supported in "satp", the
    corresponding "hgatp" SvNNx4 mode is supported.  The "hgatp" mode Bare
    is also supported.

[Implications]

(Due to reservation set size constraints)
-   'Za64rs' -> 'Za128rs'

(Due to the fact that a privileged "extension" directly refers a CSR)
-   'Svbare'       -> 'Zicsr'
-   'Sstvecd'      -> 'Zicsr'
-   'Sstvala'      -> 'Zicsr'
-   'Sscounterenw' -> 'Zicsr'
-   'Ssu64xl'      -> 'Zicsr'

(Due to the fact that a privileged "extension" indirectly depends on CSRs)
-   'Svade' -> 'Zicsr'

(Due to the fact that a privileged "extension" is a hypervisor property)
-   'Shcounterenw' -> 'H'
-   'Shvstvala'    -> 'H'
-   'Shtvala'      -> 'H'
-   'Shvstvecd'    -> 'H'
-   'Shvsatpa'     -> 'H'
-   'Shgatpa'      -> 'H'

bfd/ChangeLog:

	* elfxx-riscv.c
	(riscv_implicit_subsets): Add 13 implication rules.
	Reorder 'H' for new 'Sh*' extensions.
	(riscv_supported_std_z_ext) Add 7 property/capability extensions.
	(riscv_supported_std_s_ext) Add 13 property/capability extensions.
---
 bfd/elfxx-riscv.c | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index b43d2cfa0fab..47dede91e064 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1105,7 +1105,6 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"g", "zicsr",	check_implicit_always},
   {"g", "zifencei",	check_implicit_always},
   {"m", "zmmul",	check_implicit_always},
-  {"h", "zicsr",	check_implicit_always},
   {"q", "d",		check_implicit_always},
   {"v", "d",		check_implicit_always},
   {"v", "zve64d",	check_implicit_always},
@@ -1144,6 +1143,7 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"zhinx", "zhinxmin",	check_implicit_always},
   {"zhinxmin", "zfinx",	check_implicit_always},
   {"zfinx", "zicsr",	check_implicit_always},
+  {"za64rs", "za128rs",	check_implicit_always},
   {"zk", "zkn",		check_implicit_always},
   {"zk", "zkr",		check_implicit_always},
   {"zk", "zkt",		check_implicit_always},
@@ -1179,10 +1179,23 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
   {"smaia", "ssaia",		check_implicit_always},
   {"smstateen", "ssstateen",	check_implicit_always},
   {"smepmp", "zicsr",		check_implicit_always},
+  {"shcounterenw", "h",		check_implicit_always},
+  {"shgatpa", "h",		check_implicit_always},
+  {"shtvala", "h",		check_implicit_always},
+  {"shvsatpa", "h",		check_implicit_always},
+  {"shvstvala", "h",		check_implicit_always},
+  {"shvstvecd", "h",		check_implicit_always},
+  {"h", "zicsr",		check_implicit_always},
   {"ssaia", "zicsr",		check_implicit_always},
   {"sscofpmf", "zicsr",		check_implicit_always},
+  {"sscounterenw", "zicsr",	check_implicit_always},
   {"ssstateen", "zicsr",	check_implicit_always},
   {"sstc", "zicsr",		check_implicit_always},
+  {"sstvala", "zicsr",		check_implicit_always},
+  {"sstvecd", "zicsr",		check_implicit_always},
+  {"ssu64xl", "zicsr",		check_implicit_always},
+  {"svade", "zicsr",		check_implicit_always},
+  {"svbare", "zicsr",		check_implicit_always},
   {NULL, NULL, NULL}
 };
 
@@ -1240,6 +1253,11 @@ static struct riscv_supported_ext riscv_supported_std_ext[] =
 
 static struct riscv_supported_ext riscv_supported_std_z_ext[] =
 {
+  {"zic64b",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccamoa",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccif",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"zicclsm",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"ziccrse",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicbom",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicbop",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zicboz",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
@@ -1250,6 +1268,8 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
   {"zifencei",		ISA_SPEC_CLASS_20190608,	2, 0,  0 },
   {"zihintpause",	ISA_SPEC_CLASS_DRAFT,		2, 0,  0 },
   {"zmmul",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"za64rs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
+  {"za128rs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zawrs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
   {"zfa",		ISA_SPEC_CLASS_DRAFT,		0, 1,  0 },
   {"zfh",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
@@ -1318,13 +1338,26 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
 
 static struct riscv_supported_ext riscv_supported_std_s_ext[] =
 {
+  {"shcounterenw",	ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shgatpa",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shtvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvsatpa",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvstvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"shvstvecd",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smaia",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smepmp",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"smstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"ssaia",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"ssccptr",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"sscofpmf",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"sscounterenw",	ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"ssstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"sstc",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"sstvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"sstvecd",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"ssu64xl",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"svade",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
+  {"svbare",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svinval",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svnapot",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
   {"svpbmt",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
-- 
2.41.0


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

* Re: [PATCH v4 1/1] RISC-V: Add platform property/capability extensions
  2023-07-26  0:05       ` [PATCH v4 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
@ 2023-07-26  0:47         ` Palmer Dabbelt
  2023-07-26  1:02           ` Tsukasa OI
  2023-07-31  2:56           ` Tsukasa OI
  0 siblings, 2 replies; 16+ messages in thread
From: Palmer Dabbelt @ 2023-07-26  0:47 UTC (permalink / raw)
  To: research_trasio; +Cc: research_trasio, nelson, kito.cheng, binutils

On Tue, 25 Jul 2023 17:05:53 PDT (-0700), research_trasio@irq.a4lg.com wrote:
> From: Tsukasa OI <research_trasio@irq.a4lg.com>
>
> RISC-V Profiles document defines number of "extensions" that indicate
> certain platform properties/capabilities just like 'Zkt' extension from the
> RISC-V cryptography extensions.
>
> This commit defines 20 platform property/capability extensions as defined
> in the RISC-V Profiles documentation.
>
> The only exception: 'Ssstateen' extension is defined separately because it
> defines a subset (supervisor/hypervisor view) of the 'Smstateen' extension.
>
> This is based on the ratified version of RISC-V Profiles:
> <https://github.com/riscv/riscv-profiles/releases/tag/v1.0>
>
> [Definition]
>
> "Main memory regions":
>     Main memory regions (in contrast to I/O or vacant memory regions) with
>     both the cacheability and coherence PMAs.
>
> [New Unprivileged Extensions]
>
> 1.  'Ziccif'
>     "Main memory regions" support instruction fetch and any instruction
>     fetches of naturally aligned power-of-2 sizes up to min(ILEN, XLEN)
>     are atomic.
> 2.  'Ziccrse'
>     "Main memory regions" provide the eventual success guarantee for
>     LR/SC sequence (RsrvEventual).
> 3.  'Ziccamoa'
>     "Main memory regions" support all currently-defined AMO operations
>     including swap, logical and arithmetic operations (AMOArithmetic).
> 4.  'Za64rs'
>     For LR/SC instructions, reservation sets are contiguous, naturally
>     aligned and at most 64-bytes in size.
> 5.  'Za128rs'
>     Likewise, but reservation sets are at most 128-bytes in size.
> 6.  'Zicclsm'
>     Misaligned loads / stores to "main memory regions" are supported.
>     Those include both regular scalar and vector accesses but does not
>     include AMOs and other specialized forms of memory accesses.
> 7.  'Zic64b'
>     Cache blocks are (exactly) 64-bytes in size and naturally aligned.

IMO we want to stay away from these extensions that are just defined by 
a single phrase in the spec.  We're still digging out from the first 
rounds of changed specs, trying to start supporting stuff that's not 
even been defined is going to just make for another round of headaches.

> [New Privileged Extensions]
>
> 1.  'Svbare'
>     "satp" mode Bare is supported.
> 2.  'Svade'
>     Page-fault exceptions are raised when a page is accessed when A bit is
>     clear, or written when D bit is clear.
> 3.  'Ssccptr'
>     "Main memory regions" support hardware page-table reads.
> 4.  'Sstvecd'
>     "stvec" mode Direct is supported.  When "stvec" mode is Direct,
>     "stvec.BASE" is capable of holding any valid 4-byte aligned address.
> 5.  'Sstvala'
>     "stval" is always written with a nonzero value whenever possible as
>     specified in the Privileged Architecture documentation
>     (version 20211203: see section 4.1.9).
> 6.  'Sscounterenw'
>     For any "hpmcounter" that is not read-only zero, the corresponding bit
>     in "scounteren" is writable.
> 7.  'Ssu64xl'
>     "sstatus.UXL" is capable of holding the value 0b10
>     (UXLEN==64 is supported).
> 8.  'Shcounterenw'
>     Similar to 'Sscounterenw' but the same rule applies to "hcounteren".
> 9.  'Shvstvala'
>     Similar to 'Sstvala' but the same rule applies to "vstval".
> 10. 'Shtvala'
>     "htval" is written with the faulting guest physical address as long as
>     permitted by the ISA (a bit similar to 'Sstvala' and 'Shvstvala').
> 11. 'Shvstvecd'
>     Similar to 'Sstvecd' but the same rule applies to "vstvec".
> 12. 'Shvsatpa'
>     All translation modes supported in "satp" are also supported in "vsatp".
> 13. 'Shgatpa'
>     For each supported virtual memory scheme SvNN supported in "satp", the
>     corresponding "hgatp" SvNNx4 mode is supported.  The "hgatp" mode Bare
>     is also supported.
>
> [Implications]
>
> (Due to reservation set size constraints)
> -   'Za64rs' -> 'Za128rs'
>
> (Due to the fact that a privileged "extension" directly refers a CSR)
> -   'Svbare'       -> 'Zicsr'
> -   'Sstvecd'      -> 'Zicsr'
> -   'Sstvala'      -> 'Zicsr'
> -   'Sscounterenw' -> 'Zicsr'
> -   'Ssu64xl'      -> 'Zicsr'
>
> (Due to the fact that a privileged "extension" indirectly depends on CSRs)
> -   'Svade' -> 'Zicsr'
>
> (Due to the fact that a privileged "extension" is a hypervisor property)
> -   'Shcounterenw' -> 'H'
> -   'Shvstvala'    -> 'H'
> -   'Shtvala'      -> 'H'
> -   'Shvstvecd'    -> 'H'
> -   'Shvsatpa'     -> 'H'
> -   'Shgatpa'      -> 'H'
>
> bfd/ChangeLog:
>
> 	* elfxx-riscv.c
> 	(riscv_implicit_subsets): Add 13 implication rules.
> 	Reorder 'H' for new 'Sh*' extensions.
> 	(riscv_supported_std_z_ext) Add 7 property/capability extensions.
> 	(riscv_supported_std_s_ext) Add 13 property/capability extensions.
> ---
>  bfd/elfxx-riscv.c | 35 ++++++++++++++++++++++++++++++++++-
>  1 file changed, 34 insertions(+), 1 deletion(-)
>
> diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
> index b43d2cfa0fab..47dede91e064 100644
> --- a/bfd/elfxx-riscv.c
> +++ b/bfd/elfxx-riscv.c
> @@ -1105,7 +1105,6 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
>    {"g", "zicsr",	check_implicit_always},
>    {"g", "zifencei",	check_implicit_always},
>    {"m", "zmmul",	check_implicit_always},
> -  {"h", "zicsr",	check_implicit_always},
>    {"q", "d",		check_implicit_always},
>    {"v", "d",		check_implicit_always},
>    {"v", "zve64d",	check_implicit_always},
> @@ -1144,6 +1143,7 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
>    {"zhinx", "zhinxmin",	check_implicit_always},
>    {"zhinxmin", "zfinx",	check_implicit_always},
>    {"zfinx", "zicsr",	check_implicit_always},
> +  {"za64rs", "za128rs",	check_implicit_always},
>    {"zk", "zkn",		check_implicit_always},
>    {"zk", "zkr",		check_implicit_always},
>    {"zk", "zkt",		check_implicit_always},
> @@ -1179,10 +1179,23 @@ static struct riscv_implicit_subset riscv_implicit_subsets[] =
>    {"smaia", "ssaia",		check_implicit_always},
>    {"smstateen", "ssstateen",	check_implicit_always},
>    {"smepmp", "zicsr",		check_implicit_always},
> +  {"shcounterenw", "h",		check_implicit_always},
> +  {"shgatpa", "h",		check_implicit_always},
> +  {"shtvala", "h",		check_implicit_always},
> +  {"shvsatpa", "h",		check_implicit_always},
> +  {"shvstvala", "h",		check_implicit_always},
> +  {"shvstvecd", "h",		check_implicit_always},
> +  {"h", "zicsr",		check_implicit_always},
>    {"ssaia", "zicsr",		check_implicit_always},
>    {"sscofpmf", "zicsr",		check_implicit_always},
> +  {"sscounterenw", "zicsr",	check_implicit_always},
>    {"ssstateen", "zicsr",	check_implicit_always},
>    {"sstc", "zicsr",		check_implicit_always},
> +  {"sstvala", "zicsr",		check_implicit_always},
> +  {"sstvecd", "zicsr",		check_implicit_always},
> +  {"ssu64xl", "zicsr",		check_implicit_always},
> +  {"svade", "zicsr",		check_implicit_always},
> +  {"svbare", "zicsr",		check_implicit_always},
>    {NULL, NULL, NULL}
>  };
>
> @@ -1240,6 +1253,11 @@ static struct riscv_supported_ext riscv_supported_std_ext[] =
>
>  static struct riscv_supported_ext riscv_supported_std_z_ext[] =
>  {
> +  {"zic64b",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
> +  {"ziccamoa",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
> +  {"ziccif",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
> +  {"zicclsm",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
> +  {"ziccrse",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
>    {"zicbom",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
>    {"zicbop",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
>    {"zicboz",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
> @@ -1250,6 +1268,8 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
>    {"zifencei",		ISA_SPEC_CLASS_20190608,	2, 0,  0 },
>    {"zihintpause",	ISA_SPEC_CLASS_DRAFT,		2, 0,  0 },
>    {"zmmul",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
> +  {"za64rs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
> +  {"za128rs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
>    {"zawrs",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
>    {"zfa",		ISA_SPEC_CLASS_DRAFT,		0, 1,  0 },
>    {"zfh",		ISA_SPEC_CLASS_DRAFT,		1, 0,  0 },
> @@ -1318,13 +1338,26 @@ static struct riscv_supported_ext riscv_supported_std_z_ext[] =
>
>  static struct riscv_supported_ext riscv_supported_std_s_ext[] =
>  {
> +  {"shcounterenw",	ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"shgatpa",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"shtvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"shvsatpa",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"shvstvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"shvstvecd",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
>    {"smaia",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
>    {"smepmp",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
>    {"smstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
>    {"ssaia",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"ssccptr",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
>    {"sscofpmf",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"sscounterenw",	ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
>    {"ssstateen",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
>    {"sstc",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"sstvala",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"sstvecd",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"ssu64xl",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"svade",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
> +  {"svbare",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
>    {"svinval",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
>    {"svnapot",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },
>    {"svpbmt",		ISA_SPEC_CLASS_DRAFT,		1, 0, 0 },

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

* Re: [PATCH v4 1/1] RISC-V: Add platform property/capability extensions
  2023-07-26  0:47         ` Palmer Dabbelt
@ 2023-07-26  1:02           ` Tsukasa OI
  2023-07-31  2:56           ` Tsukasa OI
  1 sibling, 0 replies; 16+ messages in thread
From: Tsukasa OI @ 2023-07-26  1:02 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: binutils

On 2023/07/26 9:47, Palmer Dabbelt wrote:
> IMO we want to stay away from these extensions that are just defined by
> a single phrase in the spec.  We're still digging out from the first
> rounds of changed specs, trying to start supporting stuff that's not
> even been defined is going to just make for another round of headaches.

I see.  I don't completely agree but it makes sense ('Zkt' for example,
has a dedicated section to describe this extension).

I think there's not so much room for improvements for many of "single
phrase" extensions (on 'Ssu64xl', I requested to clarify some details
before the ratification; 'Zic64b' describes itself completely and adding
more words won't work; definition of 'Zicclsm' on the other hand, might
be better to be a bit stricter).  However, I see they are not so urgent.

As long as this patch set is considered as a prerequisite of further
"RISC-V Profiles" support (e.g. "-march=rva..."), I can wait.

Thanks,
Tsukasa

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

* Re: [PATCH v4 1/1] RISC-V: Add platform property/capability extensions
  2023-07-26  0:47         ` Palmer Dabbelt
  2023-07-26  1:02           ` Tsukasa OI
@ 2023-07-31  2:56           ` Tsukasa OI
  1 sibling, 0 replies; 16+ messages in thread
From: Tsukasa OI @ 2023-07-31  2:56 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: binutils

Again, I'm not strongly object this decision but I'll note a background
before I forget again (and in July, before the thread tree in the
Binutils Archives website breaks).

My initial patch set (in 2022-11)
<https://sourceware.org/pipermail/binutils/2022-November/124155.html>

is approved by Nelson once.
<https://sourceware.org/pipermail/binutils/2022-November/124158.html>

But I decided not to commit it because I felt something in the RISC-V
Profiles specification will likely change (despite it being frozen; and
it did, 'Ssptead' was renamed to 'Svade' and 'Sscounterenw' was added).

I'm **not** going through using this approval since it's too old.  But I
will appreciate if you consider this a little.  As I replied earlier, I
can wait until RISC-V Profiles through "-march" is supported.

<https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/36>

Thanks,
Tsukasa


On 2023/07/26 9:47, Palmer Dabbelt wrote:
> On Tue, 25 Jul 2023 17:05:53 PDT (-0700), research_trasio@irq.a4lg.com
> wrote:
>> From: Tsukasa OI <research_trasio@irq.a4lg.com>
>>
>> RISC-V Profiles document defines number of "extensions" that indicate
>> certain platform properties/capabilities just like 'Zkt' extension
>> from the
>> RISC-V cryptography extensions.
>>
>> This commit defines 20 platform property/capability extensions as defined
>> in the RISC-V Profiles documentation.
>>
>> The only exception: 'Ssstateen' extension is defined separately
>> because it
>> defines a subset (supervisor/hypervisor view) of the 'Smstateen'
>> extension.
>>
>> This is based on the ratified version of RISC-V Profiles:
>> <https://github.com/riscv/riscv-profiles/releases/tag/v1.0>
>>
>> [Definition]
>>
>> "Main memory regions":
>>     Main memory regions (in contrast to I/O or vacant memory regions)
>> with
>>     both the cacheability and coherence PMAs.
>>
>> [New Unprivileged Extensions]
>>
>> 1.  'Ziccif'
>>     "Main memory regions" support instruction fetch and any instruction
>>     fetches of naturally aligned power-of-2 sizes up to min(ILEN, XLEN)
>>     are atomic.
>> 2.  'Ziccrse'
>>     "Main memory regions" provide the eventual success guarantee for
>>     LR/SC sequence (RsrvEventual).
>> 3.  'Ziccamoa'
>>     "Main memory regions" support all currently-defined AMO operations
>>     including swap, logical and arithmetic operations (AMOArithmetic).
>> 4.  'Za64rs'
>>     For LR/SC instructions, reservation sets are contiguous, naturally
>>     aligned and at most 64-bytes in size.
>> 5.  'Za128rs'
>>     Likewise, but reservation sets are at most 128-bytes in size.
>> 6.  'Zicclsm'
>>     Misaligned loads / stores to "main memory regions" are supported.
>>     Those include both regular scalar and vector accesses but does not
>>     include AMOs and other specialized forms of memory accesses.
>> 7.  'Zic64b'
>>     Cache blocks are (exactly) 64-bytes in size and naturally aligned.
> 
> IMO we want to stay away from these extensions that are just defined by
> a single phrase in the spec.  We're still digging out from the first
> rounds of changed specs, trying to start supporting stuff that's not
> even been defined is going to just make for another round of headaches.
> 
>> [New Privileged Extensions]
>>
>> 1.  'Svbare'
>>     "satp" mode Bare is supported.
>> 2.  'Svade'
>>     Page-fault exceptions are raised when a page is accessed when A
>> bit is
>>     clear, or written when D bit is clear.
>> 3.  'Ssccptr'
>>     "Main memory regions" support hardware page-table reads.
>> 4.  'Sstvecd'
>>     "stvec" mode Direct is supported.  When "stvec" mode is Direct,
>>     "stvec.BASE" is capable of holding any valid 4-byte aligned address.
>> 5.  'Sstvala'
>>     "stval" is always written with a nonzero value whenever possible as
>>     specified in the Privileged Architecture documentation
>>     (version 20211203: see section 4.1.9).
>> 6.  'Sscounterenw'
>>     For any "hpmcounter" that is not read-only zero, the corresponding
>> bit
>>     in "scounteren" is writable.
>> 7.  'Ssu64xl'
>>     "sstatus.UXL" is capable of holding the value 0b10
>>     (UXLEN==64 is supported).
>> 8.  'Shcounterenw'
>>     Similar to 'Sscounterenw' but the same rule applies to "hcounteren".
>> 9.  'Shvstvala'
>>     Similar to 'Sstvala' but the same rule applies to "vstval".
>> 10. 'Shtvala'
>>     "htval" is written with the faulting guest physical address as
>> long as
>>     permitted by the ISA (a bit similar to 'Sstvala' and 'Shvstvala').
>> 11. 'Shvstvecd'
>>     Similar to 'Sstvecd' but the same rule applies to "vstvec".
>> 12. 'Shvsatpa'
>>     All translation modes supported in "satp" are also supported in
>> "vsatp".
>> 13. 'Shgatpa'
>>     For each supported virtual memory scheme SvNN supported in "satp",
>> the
>>     corresponding "hgatp" SvNNx4 mode is supported.  The "hgatp" mode
>> Bare
>>     is also supported.
>>
>> [Implications]
>>
>> (Due to reservation set size constraints)
>> -   'Za64rs' -> 'Za128rs'
>>
>> (Due to the fact that a privileged "extension" directly refers a CSR)
>> -   'Svbare'       -> 'Zicsr'
>> -   'Sstvecd'      -> 'Zicsr'
>> -   'Sstvala'      -> 'Zicsr'
>> -   'Sscounterenw' -> 'Zicsr'
>> -   'Ssu64xl'      -> 'Zicsr'
>>
>> (Due to the fact that a privileged "extension" indirectly depends on
>> CSRs)
>> -   'Svade' -> 'Zicsr'
>>
>> (Due to the fact that a privileged "extension" is a hypervisor property)
>> -   'Shcounterenw' -> 'H'
>> -   'Shvstvala'    -> 'H'
>> -   'Shtvala'      -> 'H'
>> -   'Shvstvecd'    -> 'H'
>> -   'Shvsatpa'     -> 'H'
>> -   'Shgatpa'      -> 'H'
>>
>> bfd/ChangeLog:
>>
>>     * elfxx-riscv.c
>>     (riscv_implicit_subsets): Add 13 implication rules.
>>     Reorder 'H' for new 'Sh*' extensions.
>>     (riscv_supported_std_z_ext) Add 7 property/capability extensions.
>>     (riscv_supported_std_s_ext) Add 13 property/capability extensions.
>> ---
>>  bfd/elfxx-riscv.c | 35 ++++++++++++++++++++++++++++++++++-
>>  1 file changed, 34 insertions(+), 1 deletion(-)
>>
>> diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
>> index b43d2cfa0fab..47dede91e064 100644
>> --- a/bfd/elfxx-riscv.c
>> +++ b/bfd/elfxx-riscv.c
>> @@ -1105,7 +1105,6 @@ static struct riscv_implicit_subset
>> riscv_implicit_subsets[] =
>>    {"g", "zicsr",    check_implicit_always},
>>    {"g", "zifencei",    check_implicit_always},
>>    {"m", "zmmul",    check_implicit_always},
>> -  {"h", "zicsr",    check_implicit_always},
>>    {"q", "d",        check_implicit_always},
>>    {"v", "d",        check_implicit_always},
>>    {"v", "zve64d",    check_implicit_always},
>> @@ -1144,6 +1143,7 @@ static struct riscv_implicit_subset
>> riscv_implicit_subsets[] =
>>    {"zhinx", "zhinxmin",    check_implicit_always},
>>    {"zhinxmin", "zfinx",    check_implicit_always},
>>    {"zfinx", "zicsr",    check_implicit_always},
>> +  {"za64rs", "za128rs",    check_implicit_always},
>>    {"zk", "zkn",        check_implicit_always},
>>    {"zk", "zkr",        check_implicit_always},
>>    {"zk", "zkt",        check_implicit_always},
>> @@ -1179,10 +1179,23 @@ static struct riscv_implicit_subset
>> riscv_implicit_subsets[] =
>>    {"smaia", "ssaia",        check_implicit_always},
>>    {"smstateen", "ssstateen",    check_implicit_always},
>>    {"smepmp", "zicsr",        check_implicit_always},
>> +  {"shcounterenw", "h",        check_implicit_always},
>> +  {"shgatpa", "h",        check_implicit_always},
>> +  {"shtvala", "h",        check_implicit_always},
>> +  {"shvsatpa", "h",        check_implicit_always},
>> +  {"shvstvala", "h",        check_implicit_always},
>> +  {"shvstvecd", "h",        check_implicit_always},
>> +  {"h", "zicsr",        check_implicit_always},
>>    {"ssaia", "zicsr",        check_implicit_always},
>>    {"sscofpmf", "zicsr",        check_implicit_always},
>> +  {"sscounterenw", "zicsr",    check_implicit_always},
>>    {"ssstateen", "zicsr",    check_implicit_always},
>>    {"sstc", "zicsr",        check_implicit_always},
>> +  {"sstvala", "zicsr",        check_implicit_always},
>> +  {"sstvecd", "zicsr",        check_implicit_always},
>> +  {"ssu64xl", "zicsr",        check_implicit_always},
>> +  {"svade", "zicsr",        check_implicit_always},
>> +  {"svbare", "zicsr",        check_implicit_always},
>>    {NULL, NULL, NULL}
>>  };
>>
>> @@ -1240,6 +1253,11 @@ static struct riscv_supported_ext
>> riscv_supported_std_ext[] =
>>
>>  static struct riscv_supported_ext riscv_supported_std_z_ext[] =
>>  {
>> +  {"zic64b",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>> +  {"ziccamoa",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>> +  {"ziccif",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>> +  {"zicclsm",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>> +  {"ziccrse",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>>    {"zicbom",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>>    {"zicbop",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>>    {"zicboz",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>> @@ -1250,6 +1268,8 @@ static struct riscv_supported_ext
>> riscv_supported_std_z_ext[] =
>>    {"zifencei",        ISA_SPEC_CLASS_20190608,    2, 0,  0 },
>>    {"zihintpause",    ISA_SPEC_CLASS_DRAFT,        2, 0,  0 },
>>    {"zmmul",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>> +  {"za64rs",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>> +  {"za128rs",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>>    {"zawrs",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>>    {"zfa",        ISA_SPEC_CLASS_DRAFT,        0, 1,  0 },
>>    {"zfh",        ISA_SPEC_CLASS_DRAFT,        1, 0,  0 },
>> @@ -1318,13 +1338,26 @@ static struct riscv_supported_ext
>> riscv_supported_std_z_ext[] =
>>
>>  static struct riscv_supported_ext riscv_supported_std_s_ext[] =
>>  {
>> +  {"shcounterenw",    ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"shgatpa",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"shtvala",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"shvsatpa",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"shvstvala",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"shvstvecd",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>>    {"smaia",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>>    {"smepmp",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>>    {"smstateen",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>>    {"ssaia",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"ssccptr",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>>    {"sscofpmf",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"sscounterenw",    ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>>    {"ssstateen",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>>    {"sstc",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"sstvala",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"sstvecd",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"ssu64xl",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"svade",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>> +  {"svbare",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>>    {"svinval",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>>    {"svnapot",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
>>    {"svpbmt",        ISA_SPEC_CLASS_DRAFT,        1, 0, 0 },
> 

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

end of thread, other threads:[~2023-07-31  2:56 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 12:26 [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
2022-11-03 12:26 ` [REVIEW ONLY 1/2] NEAR-RATIFICATION RISC-V: Add 'Ssstateen' extension and its CSRs Tsukasa OI
2022-11-03 12:26 ` [REVIEW ONLY 2/2] NEAR-RATIFICATION RISC-V: Add platform property/capability extensions Tsukasa OI
2022-11-03 13:11 ` [REVIEW ONLY 0/2] NEAR RATIFICATION RISC-V: Extensions from the RISC-V Profiles Nelson Chu
2022-11-03 13:20   ` Tsukasa OI
2022-11-19  2:56   ` Tsukasa OI
2023-01-30  6:35 ` [PATCH v2 0/1] " Tsukasa OI
2023-01-30  6:35   ` [PATCH v2 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
2023-01-30  7:11   ` [PATCH v3 0/1] RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
2023-01-30  7:11     ` [PATCH v3 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
2023-07-26  0:05     ` [PATCH v4 0/1] RISC-V: Extensions from the RISC-V Profiles Tsukasa OI
2023-07-26  0:05       ` [PATCH v4 1/1] RISC-V: Add platform property/capability extensions Tsukasa OI
2023-07-26  0:47         ` Palmer Dabbelt
2023-07-26  1:02           ` Tsukasa OI
2023-07-31  2:56           ` Tsukasa OI
2023-01-31  4:46   ` [PATCH v2 0/1] RISC-V: Extensions from the RISC-V Profiles Nelson Chu

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 read-only IMAP folder(s) and NNTP newsgroup(s).