Skip to contentSkip to conversation

RISC-V: Add Zicclsm extension support

PATCH In review Jesse Taube 4 participants 8 messages Aug 9, 2024 – Aug 12, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover RISC-V: Add Zicclsm extension support

This set is the first two commits of
RISC-V: Detect and report speed of unaligned vector accesses [1] rebased onto palmer/for-next.

The rational for adding Zicclsm was related to detecting unaligned vector accesses though this reasoning is gone.

I don't see why Zicclsm shouldn't be added which is why I'm sending this set.

[1] https://lore.kernel.org/all/[email protected]/

Jesse Taube (2):
RISC-V: Add Zicclsm to cpufeature and hwprobe
dt-bindings: riscv: Add Zicclsm ISA extension description.

 Documentation/arch/riscv/hwprobe.rst                    | 5 +++++
 Documentation/devicetree/bindings/riscv/extensions.yaml | 7 +++++++
 arch/riscv/include/asm/hwcap.h                          | 1 +
 arch/riscv/include/uapi/asm/hwprobe.h                   | 1 +
 arch/riscv/kernel/cpufeature.c                          | 1 +
 arch/riscv/kernel/sys_hwprobe.c                         | 1 +
 6 files changed, 16 insertions(+)

---
base-commit: 2d1f51d8a4b0c3fc0b2b79d4e5b95a6813500092

Signature · 1 line
2.45.2
#1 lore raw

PATCH 1/2 RISC-V: Add Zicclsm to cpufeature and hwprobe

Quoted 10 lines

Zicclsm Misaligned loads and stores to main memory regions with both the cacheability and coherence PMAs must be supported. Note:
This introduces a new extension name for this feature. This requires misaligned support for all regular load and store instructions (including scalar and vector) but not AMOs or other specialized forms of memory access. Even though mandated, misaligned loads and stores might execute extremely slowly. Standard software distributions should assume their existence only for correctness, not for performance.

---
V1 -> V2:
- Add documentation for Zicclsm
- Move Zicclsm to correct location
V2 -> V3:
- No changes
V3 -> V4:
- Add definitions to hwprobe.rst
V4 -> V5:
- No changes
V5 -> V6:
- No changes
V6 -> V7:
- No changes
V7 -> V8:
- Rebase onto 2d1f51d8a4b0 (palmer/for-next)
- Change commit description

---
 Documentation/arch/riscv/hwprobe.rst  | 5 +++++
 arch/riscv/include/asm/hwcap.h        | 1 +
 arch/riscv/include/uapi/asm/hwprobe.h | 1 +
 arch/riscv/kernel/cpufeature.c        | 1 +
 arch/riscv/kernel/sys_hwprobe.c       | 1 +
 5 files changed, 9 insertions(+)
Documentation/arch/riscv/hwprobe.rst +5 -0
index 3db60a0911df..22c118df520b 100644
@@ -239,6 +239,11 @@ The following keys are defined:
        ratified in commit 98918c844281 ("Merge pull request #1217 from
        riscv/zawrs") of riscv-isa-manual.
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZICCLSM`:  The Zicclsm extension is supported as
+        defined in the RISC-V RVA Profiles Specification. Misaligned support for
+        all regular load and store instructions (including scalar and vector) but
+        not AMOs or other specialized forms of memory access.
+
 * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance
   information about the selected set of processors.
 
arch/riscv/include/asm/hwcap.h +1 -0
index 5a0bd27fd11a..c93d957458f0 100644
@@ -92,6 +92,7 @@
 #define RISCV_ISA_EXT_ZCF		83
 #define RISCV_ISA_EXT_ZCMOP		84
 #define RISCV_ISA_EXT_ZAWRS		85
+#define RISCV_ISA_EXT_ZICCLSM		86
 
 #define RISCV_ISA_EXT_XLINUXENVCFG	127
 
arch/riscv/include/uapi/asm/hwprobe.h +1 -0
index b706c8e47b02..a9370968fc9f 100644
@@ -72,6 +72,7 @@ struct riscv_hwprobe {
 #define		RISCV_HWPROBE_EXT_ZCF		(1ULL << 46)
 #define		RISCV_HWPROBE_EXT_ZCMOP		(1ULL << 47)
 #define		RISCV_HWPROBE_EXT_ZAWRS		(1ULL << 48)
+#define		RISCV_HWPROBE_EXT_ZICCLSM	(1ULL << 49)
 #define RISCV_HWPROBE_KEY_CPUPERF_0	5
 #define		RISCV_HWPROBE_MISALIGNED_UNKNOWN	(0 << 0)
 #define		RISCV_HWPROBE_MISALIGNED_EMULATED	(1 << 0)
arch/riscv/kernel/cpufeature.c +1 -0
index 8f20607adb40..2f54d811a9b8 100644
@@ -314,6 +314,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
 					  riscv_ext_zicbom_validate),
 	__RISCV_ISA_EXT_SUPERSET_VALIDATE(zicboz, RISCV_ISA_EXT_ZICBOZ, riscv_xlinuxenvcfg_exts,
 					  riscv_ext_zicboz_validate),
+	__RISCV_ISA_EXT_DATA(zicclsm, RISCV_ISA_EXT_ZICCLSM),
 	__RISCV_ISA_EXT_DATA(zicntr, RISCV_ISA_EXT_ZICNTR),
 	__RISCV_ISA_EXT_DATA(zicond, RISCV_ISA_EXT_ZICOND),
 	__RISCV_ISA_EXT_DATA(zicsr, RISCV_ISA_EXT_ZICSR),
arch/riscv/kernel/sys_hwprobe.c +1 -0
index 8d1b5c35d2a7..01eea29a56cd 100644
@@ -107,6 +107,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
 		EXT_KEY(ZCB);
 		EXT_KEY(ZCMOP);
 		EXT_KEY(ZICBOZ);
+		EXT_KEY(ZICCLSM);
 		EXT_KEY(ZICOND);
 		EXT_KEY(ZIHINTNTL);
 		EXT_KEY(ZIHINTPAUSE);
Signature · 1 line
2.45.2
Reviewed-by Tested-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] RISC-V: Add Zicclsm to cpufeature and hwprobe

Quoted 10 lines · Jesse Taube
Quoted 10 lines

Zicclsm Misaligned loads and stores to main memory regions with both the cacheability and coherence PMAs must be supported. Note:
This introduces a new extension name for this feature. This requires misaligned support for all regular load and store instructions (including scalar and vector) but not AMOs or other specialized forms of memory access. Even though mandated, misaligned loads and stores might execute extremely slowly. Standard software distributions should assume their existence only for correctness, not for performance.

You left in the > characters.

Quoted 96 lines

---
V1 -> V2:
- Add documentation for Zicclsm
- Move Zicclsm to correct location
V2 -> V3:
- No changes
V3 -> V4:
- Add definitions to hwprobe.rst
V4 -> V5:
- No changes
V5 -> V6:
- No changes
V6 -> V7:
- No changes
V7 -> V8:
- Rebase onto 2d1f51d8a4b0 (palmer/for-next)
- Change commit description

---
 Documentation/arch/riscv/hwprobe.rst  | 5 +++++
 arch/riscv/include/asm/hwcap.h        | 1 +
 arch/riscv/include/uapi/asm/hwprobe.h | 1 +
 arch/riscv/kernel/cpufeature.c        | 1 +
 arch/riscv/kernel/sys_hwprobe.c       | 1 +
 5 files changed, 9 insertions(+)
Documentation/arch/riscv/hwprobe.rst +5 -0
index 3db60a0911df..22c118df520b 100644
@@ -239,6 +239,11 @@ The following keys are defined:
        ratified in commit 98918c844281 ("Merge pull request #1217 from
        riscv/zawrs") of riscv-isa-manual.
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZICCLSM`:  The Zicclsm extension is supported as
+        defined in the RISC-V RVA Profiles Specification. Misaligned support for
+        all regular load and store instructions (including scalar and vector) but
+        not AMOs or other specialized forms of memory access.
+
 * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance
   information about the selected set of processors.
 
arch/riscv/include/asm/hwcap.h +1 -0
index 5a0bd27fd11a..c93d957458f0 100644
@@ -92,6 +92,7 @@
 #define RISCV_ISA_EXT_ZCF		83
 #define RISCV_ISA_EXT_ZCMOP		84
 #define RISCV_ISA_EXT_ZAWRS		85
+#define RISCV_ISA_EXT_ZICCLSM		86
 
 #define RISCV_ISA_EXT_XLINUXENVCFG	127
 
arch/riscv/include/uapi/asm/hwprobe.h +1 -0
index b706c8e47b02..a9370968fc9f 100644
@@ -72,6 +72,7 @@ struct riscv_hwprobe {
 #define		RISCV_HWPROBE_EXT_ZCF		(1ULL << 46)
 #define		RISCV_HWPROBE_EXT_ZCMOP		(1ULL << 47)
 #define		RISCV_HWPROBE_EXT_ZAWRS		(1ULL << 48)
+#define		RISCV_HWPROBE_EXT_ZICCLSM	(1ULL << 49)
 #define RISCV_HWPROBE_KEY_CPUPERF_0	5
 #define		RISCV_HWPROBE_MISALIGNED_UNKNOWN	(0 << 0)
 #define		RISCV_HWPROBE_MISALIGNED_EMULATED	(1 << 0)
arch/riscv/kernel/cpufeature.c +1 -0
index 8f20607adb40..2f54d811a9b8 100644
@@ -314,6 +314,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
 					  riscv_ext_zicbom_validate),
 	__RISCV_ISA_EXT_SUPERSET_VALIDATE(zicboz, RISCV_ISA_EXT_ZICBOZ, riscv_xlinuxenvcfg_exts,
 					  riscv_ext_zicboz_validate),
+	__RISCV_ISA_EXT_DATA(zicclsm, RISCV_ISA_EXT_ZICCLSM),
 	__RISCV_ISA_EXT_DATA(zicntr, RISCV_ISA_EXT_ZICNTR),
 	__RISCV_ISA_EXT_DATA(zicond, RISCV_ISA_EXT_ZICOND),
 	__RISCV_ISA_EXT_DATA(zicsr, RISCV_ISA_EXT_ZICSR),
arch/riscv/kernel/sys_hwprobe.c +1 -0
index 8d1b5c35d2a7..01eea29a56cd 100644
@@ -107,6 +107,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
 		EXT_KEY(ZCB);
 		EXT_KEY(ZCMOP);
 		EXT_KEY(ZICBOZ);
+		EXT_KEY(ZICCLSM);
 		EXT_KEY(ZICOND);
 		EXT_KEY(ZIHINTNTL);
 		EXT_KEY(ZIHINTPAUSE);
Signature · 1 line
2.45.2
#3 lore raw

PATCH 2/2 dt-bindings: riscv: Add Zicclsm ISA extension description.

In reply to Jesse Taube

Add description for Zicclsm ISA extension.

---
V1 -> V2:
- New patch
V2 -> V3:
- No changes
V3 -> V4:
- No changes
V4 -> V5:
- No changes
V5 -> V6:
- No changes
V6 -> V7:
- No changes
V7 -> V8:
- Rebase onto 2d1f51d8a4b0 (palmer/for-next)

---
 Documentation/devicetree/bindings/riscv/extensions.yaml | 7 +++++++
 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/riscv/extensions.yaml +7 -0
index a06dbc6b4928..d06ee82abcc1 100644
@@ -361,6 +361,13 @@ properties:
             The standard Zicboz extension for cache-block zeroing as ratified
             in commit 3dd606f ("Create cmobase-v1.0.pdf") of riscv-CMOs.
 
+        - const: zicclsm
+          description:
+            The standard Zicclsm extension for misaligned support for all regular
+            load and store instructions (including scalar and vector) but not AMOs
+            or other specialized forms of memory access. Defined in the
+            RISC-V RVA Profiles Specification.
+
         - const: zicntr
           description:
             The standard Zicntr extension for base counters and timers, as
Signature · 1 line
2.45.2
maintainer
#4 lore raw

Re: [PATCH 2/2] dt-bindings: riscv: Add Zicclsm ISA extension description.

Quoted 4 lines · Jesse Taube

Add description for Zicclsm ISA extension.

Quoted 15 lines

---
V1 -> V2:
- New patch
V2 -> V3:
- No changes
V3 -> V4:
- No changes
V4 -> V5:
- No changes
V5 -> V6:
- No changes
V6 -> V7:
- No changes
V7 -> V8:
- Rebase onto 2d1f51d8a4b0 (palmer/for-next)

Please also put the version in the subject. '-vN' is the git-send-email option to do it for you.

Rob

Reviewed-by
#5 lore raw

Re: [PATCH 2/2] dt-bindings: riscv: Add Zicclsm ISA extension description.

Quoted 5 lines · Rob Herring
Quoted 4 lines · Jesse Taube

Add description for Zicclsm ISA extension.

Quoted 16 lines
Quoted 7 lines

---
V1 -> V2:
- New patch
V2 -> V3:
- No changes
V3 -> V4:
- No changes

Quoted 8 lines

V4 -> V5:
- No changes
V5 -> V6:
- No changes
V6 -> V7:
- No changes
V7 -> V8:
- Rebase onto 2d1f51d8a4b0 (palmer/for-next)

Quoted 5 lines

Please also put the version in the subject. '-vN' is the git-send-email option to do it for you.

Rob

These patches were originally part of a different series [1] but are no longer related to that series so I had asked Jesse to spin these off into a different series. These version tags probably should not have been left on here when made into this new series though.

- Charlie

Link:
https://lore.kernel.org/lkml/[email protected]/
[1]

#6 lore raw

Re: [PATCH 2/2] dt-bindings: riscv: Add Zicclsm ISA extension description.

Quoted 26 lines · Charlie Jenkins
Quoted 5 lines · Rob Herring
Quoted 4 lines · Jesse Taube

Add description for Zicclsm ISA extension.

Quoted 19 lines
Quoted 7 lines

---
V1 -> V2:
- New patch
V2 -> V3:
- No changes
V3 -> V4:
- No changes

Quoted 8 lines

V4 -> V5:
- No changes
V5 -> V6:
- No changes
V6 -> V7:
- No changes
V7 -> V8:
- Rebase onto 2d1f51d8a4b0 (palmer/for-next)

Please also put the version in the subject. '-vN' is the git-send-email option to do it for you.

Quoted 7 lines
Quoted 2 lines

Rob

These patches were originally part of a different series [1] but are no longer related to that series so I had asked Jesse to spin these off into a different series. These version tags probably should not have been left on here when made into this new series though.

I dunno, I disagree. I think the versioning should continue on being split - especially when there's been tags provided on earlier versions.

#7 lore raw

Re: [PATCH 2/2] dt-bindings: riscv: Add Zicclsm ISA extension description.

Quoted 30 lines · Conor Dooley
Quoted 29 lines · Charlie Jenkins
Quoted 5 lines · Rob Herring
Quoted 4 lines · Jesse Taube

Add description for Zicclsm ISA extension.

Quoted 21 lines
Quoted 7 lines

---
V1 -> V2:
- New patch
V2 -> V3:
- No changes
V3 -> V4:
- No changes

Quoted 8 lines

V4 -> V5:
- No changes
V5 -> V6:
- No changes
V6 -> V7:
- No changes
V7 -> V8:
- Rebase onto 2d1f51d8a4b0 (palmer/for-next)

Please also put the version in the subject. '-vN' is the git-send-email option to do it for you.

Rob

Quoted 7 lines
Quoted 4 lines

These patches were originally part of a different series [1] but are no longer related to that series so I had asked Jesse to spin these off into a different series. These version tags probably should not have been left on here when made into this new series though.

I dunno, I disagree. I think the versioning should continue on being split - especially when there's been tags provided on earlier versions.

Good to know I should keep the version number when splinting a set.

Thanks,
Jesse