linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Add Zilsd/Zclsd support in hwprobe and KVM
@ 2025-08-26 16:29 Pincheng Wang
  2025-08-26 16:29 ` [PATCH v2 1/5] dt-bindings: riscv: add Zilsd and Zclsd extension descriptions Pincheng Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Pincheng Wang @ 2025-08-26 16:29 UTC (permalink / raw)
  To: paul.walmsley, palmer, aou, alex, robh, krzk+dt, conor+dt, anup,
	pbonzini, shuah, cyan.yang, cleger, charlie, cuiyunhui,
	samuel.holland, namcao, jesse, inochiama, yongxuan.wang, ajones,
	parri.andrea, mikisabate, yikming2222, thomas.weissschuh
  Cc: linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest, pincheng.plct

Hi all,

This is v2 of a short series that adds kernel support for the ratified
Zilsd (Load/Store pair) and Zclsd (Compressed Load/Store pair) RISC-V
ISA extensions. The series enables kernel-side exposure so user-space
(for example glibc) can detect and use these extensions via hwprobe and
runtime checks.

Patches:
- Patch 1:Add device tree bindings documentation for Zilsd and Zclsd.
- Patch 2: Extend RISC-V ISA extension string parsing to recognize them.
- Patch 3: Export Zilsd and Zclsd via riscv_hwprobe.
- Patch 4: Allow KVM guests to use them.
- Patch 5: Add KVM selftests.

Changes in v2:
- Device-tree schema: simplified the rv64 validation for Zilsd by
  removing a redundant `contais: const: zilsd` in the `if` clause; the
  simpler `if (riscv, isa-base contains rv64i) then (riscv,
  isa-extension not contains zilsd)` form is used instead. Behaviour is
  unchanged, and the logic is cleaner.
- Device-tree schema: corrected Zclsd dependency to require both Zilsd
  and Zca (previous `anyOf` was incorrect; now both are enforced).
- Commit message typo fixed: "dt-bidings" -> "dt-bindings" in the Patch
  1 commit subject.

The v2 changes are documentation/schema corrections in extensions.yaml.
No functional changes were made to ISA parsing, hwprobe syscall, KVM
guest support or the selftests beyond ensuring the binding correctly
documents and validates the extension relationships.

Please review v2 and advise if futher changes are needed.

Thanks,
Pincheng Wang 

Pincheng Wang (5):
  dt-bindings: riscv: add Zilsd and Zclsd extension descriptions
  riscv: add ISA extension parsing for Zilsd and Zclsd
  riscv: hwprobe: export Zilsd and Zclsd ISA extensions
  riscv: KVM: allow Zilsd and Zclsd extensions for Guest/VM
  KVM: riscv: selftests: add Zilsd and Zclsd extension to get-reg-list
    test

 Documentation/arch/riscv/hwprobe.rst          |  8 +++++
 .../devicetree/bindings/riscv/extensions.yaml | 36 +++++++++++++++++++
 arch/riscv/include/asm/hwcap.h                |  2 ++
 arch/riscv/include/uapi/asm/hwprobe.h         |  2 ++
 arch/riscv/include/uapi/asm/kvm.h             |  2 ++
 arch/riscv/kernel/cpufeature.c                | 24 +++++++++++++
 arch/riscv/kernel/sys_hwprobe.c               |  2 ++
 arch/riscv/kvm/vcpu_onereg.c                  |  2 ++
 .../selftests/kvm/riscv/get-reg-list.c        |  6 ++++
 9 files changed, 84 insertions(+)

-- 
2.39.5


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH v2 1/5] dt-bindings: riscv: add Zilsd and Zclsd extension descriptions
  2025-08-26 16:29 [PATCH v2 0/5] Add Zilsd/Zclsd support in hwprobe and KVM Pincheng Wang
@ 2025-08-26 16:29 ` Pincheng Wang
  2025-08-26 17:39   ` Conor Dooley
  2025-09-01  8:46   ` Nutty.Liu
  2025-08-26 16:29 ` [PATCH v2 2/5] riscv: add ISA extension parsing for Zilsd and Zclsd Pincheng Wang
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 12+ messages in thread
From: Pincheng Wang @ 2025-08-26 16:29 UTC (permalink / raw)
  To: paul.walmsley, palmer, aou, alex, robh, krzk+dt, conor+dt, anup,
	pbonzini, shuah, cyan.yang, cleger, charlie, cuiyunhui,
	samuel.holland, namcao, jesse, inochiama, yongxuan.wang, ajones,
	parri.andrea, mikisabate, yikming2222, thomas.weissschuh
  Cc: linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest, pincheng.plct

Add descriptions for the Zilsd (Load/Store pair instructions) and
Zclsd (Compressed Load/Store pair instructions) ISA extensions
which were ratified in commit f88abf1 ("Integrating load/store
pair for RV32 with the main manual") of the riscv-isa-manual.

Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
---
 .../devicetree/bindings/riscv/extensions.yaml | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml
index ede6a58ccf53..c562c4dbbe9d 100644
--- a/Documentation/devicetree/bindings/riscv/extensions.yaml
+++ b/Documentation/devicetree/bindings/riscv/extensions.yaml
@@ -366,6 +366,20 @@ properties:
             guarantee on LR/SC sequences, as ratified in commit b1d806605f87
             ("Updated to ratified state.") of the riscv profiles specification.

+        - const: zilsd
+          description:
+            The standard Zilsd extension which provides support for aligned
+            register-pair load and store operations in 32-bit instruction
+            encodings, as ratified in commit f88abf1 ("Integrating
+            load/store pair for RV32 with the main manual") of riscv-isa-manual.
+
+        - const: zclsd
+          description:
+            The Zclsd extension implements the compressed (16-bit) version of the
+            Load/Store Pair for RV32. As with Zilsd, this extension was ratified
+            in commit f88abf1 ("Integrating load/store pair for RV32 with the
+            main manual") of riscv-isa-manual.
+
         - const: zk
           description:
             The standard Zk Standard Scalar cryptography extension as ratified
@@ -847,6 +861,16 @@ properties:
             anyOf:
               - const: v
               - const: zve32x
+      # Zclsd depends on Zilsd and Zca
+      - if:
+          contains:
+            anyOf:
+              - const: zclsd
+        then:
+          contains:
+            allOf:
+              - const: zilsd
+              - const: zca
 
 allOf:
   # Zcf extension does not exist on rv64
@@ -864,6 +888,18 @@ allOf:
           not:
             contains:
               const: zcf
+  # Zilsd extension does not exist on rv64
+  - if:
+      properties:
+        riscv,isa-base:
+          contains:
+            const: rv64i
+    then:
+      properties:
+        riscv,isa-extensions:
+          not:
+            contains:
+              const: zilsd
 
 additionalProperties: true
 ...
-- 
2.39.5


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH v2 2/5] riscv: add ISA extension parsing for Zilsd and Zclsd
  2025-08-26 16:29 [PATCH v2 0/5] Add Zilsd/Zclsd support in hwprobe and KVM Pincheng Wang
  2025-08-26 16:29 ` [PATCH v2 1/5] dt-bindings: riscv: add Zilsd and Zclsd extension descriptions Pincheng Wang
@ 2025-08-26 16:29 ` Pincheng Wang
  2025-09-01  8:41   ` Nutty.Liu
  2025-08-26 16:29 ` [PATCH v2 3/5] riscv: hwprobe: export Zilsd and Zclsd ISA extensions Pincheng Wang
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Pincheng Wang @ 2025-08-26 16:29 UTC (permalink / raw)
  To: paul.walmsley, palmer, aou, alex, robh, krzk+dt, conor+dt, anup,
	pbonzini, shuah, cyan.yang, cleger, charlie, cuiyunhui,
	samuel.holland, namcao, jesse, inochiama, yongxuan.wang, ajones,
	parri.andrea, mikisabate, yikming2222, thomas.weissschuh
  Cc: linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest, pincheng.plct

Add parsing for Zilsd and Zclsd ISA extensions which were ratified in
commit f88abf1 ("Integrating load/store pair for RV32 with the
main manual") of the riscv-isa-manual.

Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
---
 arch/riscv/include/asm/hwcap.h |  2 ++
 arch/riscv/kernel/cpufeature.c | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h
index affd63e11b0a..7ad43d12c49f 100644
--- a/arch/riscv/include/asm/hwcap.h
+++ b/arch/riscv/include/asm/hwcap.h
@@ -106,6 +106,8 @@
 #define RISCV_ISA_EXT_ZAAMO		97
 #define RISCV_ISA_EXT_ZALRSC		98
 #define RISCV_ISA_EXT_ZICBOP		99
+#define RISCV_ISA_EXT_ZILSD		100
+#define RISCV_ISA_EXT_ZCLSD     101
 
 #define RISCV_ISA_EXT_XLINUXENVCFG	127
 
diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c
index 743d53415572..8e7757db3895 100644
--- a/arch/riscv/kernel/cpufeature.c
+++ b/arch/riscv/kernel/cpufeature.c
@@ -242,6 +242,28 @@ static int riscv_ext_zcf_validate(const struct riscv_isa_ext_data *data,
 	return -EPROBE_DEFER;
 }
 
+static int riscv_ext_zilsd_validate(const struct riscv_isa_ext_data *data,
+		  const unsigned long *isa_bitmap)
+{
+	if (IS_ENABLED(CONFIG_64BIT))
+		return -EINVAL;
+
+	return 0;
+}
+
+static int riscv_ext_zclsd_validate(const struct riscv_isa_ext_data *data,
+				    const unsigned long *isa_bitmap)
+{
+	if (IS_ENABLED(CONFIG_64BIT))
+		return -EINVAL;
+
+	if (__riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_ZILSD) &&
+		__riscv_isa_extension_available(isa_bitmap, RISCV_ISA_EXT_ZCA))
+		return 0;
+
+	return -EPROBE_DEFER;
+}
+
 static int riscv_vector_f_validate(const struct riscv_isa_ext_data *data,
 				   const unsigned long *isa_bitmap)
 {
@@ -483,6 +505,8 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = {
 	__RISCV_ISA_EXT_DATA_VALIDATE(zcd, RISCV_ISA_EXT_ZCD, riscv_ext_zcd_validate),
 	__RISCV_ISA_EXT_DATA_VALIDATE(zcf, RISCV_ISA_EXT_ZCF, riscv_ext_zcf_validate),
 	__RISCV_ISA_EXT_DATA_VALIDATE(zcmop, RISCV_ISA_EXT_ZCMOP, riscv_ext_zca_depends),
+	__RISCV_ISA_EXT_DATA_VALIDATE(zclsd, RISCV_ISA_EXT_ZCLSD, riscv_ext_zclsd_validate),
+	__RISCV_ISA_EXT_DATA_VALIDATE(zilsd, RISCV_ISA_EXT_ZILSD, riscv_ext_zilsd_validate),
 	__RISCV_ISA_EXT_DATA(zba, RISCV_ISA_EXT_ZBA),
 	__RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB),
 	__RISCV_ISA_EXT_DATA(zbc, RISCV_ISA_EXT_ZBC),
-- 
2.39.5


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH v2 3/5] riscv: hwprobe: export Zilsd and Zclsd ISA extensions
  2025-08-26 16:29 [PATCH v2 0/5] Add Zilsd/Zclsd support in hwprobe and KVM Pincheng Wang
  2025-08-26 16:29 ` [PATCH v2 1/5] dt-bindings: riscv: add Zilsd and Zclsd extension descriptions Pincheng Wang
  2025-08-26 16:29 ` [PATCH v2 2/5] riscv: add ISA extension parsing for Zilsd and Zclsd Pincheng Wang
@ 2025-08-26 16:29 ` Pincheng Wang
  2025-09-01  8:39   ` Nutty.Liu
  2025-08-26 16:29 ` [PATCH v2 4/5] riscv: KVM: allow Zilsd and Zclsd extensions for Guest/VM Pincheng Wang
  2025-08-26 16:29 ` [PATCH v2 5/5] KVM: riscv: selftests: add Zilsd and Zclsd extension to get-reg-list test Pincheng Wang
  4 siblings, 1 reply; 12+ messages in thread
From: Pincheng Wang @ 2025-08-26 16:29 UTC (permalink / raw)
  To: paul.walmsley, palmer, aou, alex, robh, krzk+dt, conor+dt, anup,
	pbonzini, shuah, cyan.yang, cleger, charlie, cuiyunhui,
	samuel.holland, namcao, jesse, inochiama, yongxuan.wang, ajones,
	parri.andrea, mikisabate, yikming2222, thomas.weissschuh
  Cc: linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest, pincheng.plct

Export Zilsd and Zclsd ISA extensions through hwprobe.

Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
---
 Documentation/arch/riscv/hwprobe.rst  | 8 ++++++++
 arch/riscv/include/uapi/asm/hwprobe.h | 2 ++
 arch/riscv/kernel/sys_hwprobe.c       | 2 ++
 3 files changed, 12 insertions(+)

diff --git a/Documentation/arch/riscv/hwprobe.rst b/Documentation/arch/riscv/hwprobe.rst
index 2aa9be272d5d..538ab6c08f7b 100644
--- a/Documentation/arch/riscv/hwprobe.rst
+++ b/Documentation/arch/riscv/hwprobe.rst
@@ -275,6 +275,14 @@ The following keys are defined:
        ratified in commit 49f49c842ff9 ("Update to Rafified state") of
        riscv-zabha.
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZILSD`: The Zilsd extension is supported as
+       defined in the RISC-V ISA manual starting from commit f88abf1("Integrating
+       load/store pair for RV32 with the main manual") of the riscv-isa-manual.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZCLSD`: The Zclsd extension is supported as
+       defined in the RISC-V ISA manual starting from commit f88abf1("Integrating
+       load/store pair for RV32 with the main manual") of the riscv-isa-manual.
+
 * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: Deprecated.  Returns similar values to
      :c:macro:`RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF`, but the key was
      mistakenly classified as a bitmask rather than a value.
diff --git a/arch/riscv/include/uapi/asm/hwprobe.h b/arch/riscv/include/uapi/asm/hwprobe.h
index aaf6ad970499..e086179bb4fa 100644
--- a/arch/riscv/include/uapi/asm/hwprobe.h
+++ b/arch/riscv/include/uapi/asm/hwprobe.h
@@ -82,6 +82,8 @@ struct riscv_hwprobe {
 #define		RISCV_HWPROBE_EXT_ZAAMO		(1ULL << 56)
 #define		RISCV_HWPROBE_EXT_ZALRSC	(1ULL << 57)
 #define		RISCV_HWPROBE_EXT_ZABHA		(1ULL << 58)
+#define	RISCV_HWPROBE_EXT_ZILSD	(1ULL << 59)
+#define	RISCV_HWPROBE_EXT_ZCLSD	(1ULL << 60)
 #define RISCV_HWPROBE_KEY_CPUPERF_0	5
 #define		RISCV_HWPROBE_MISALIGNED_UNKNOWN	(0 << 0)
 #define		RISCV_HWPROBE_MISALIGNED_EMULATED	(1 << 0)
diff --git a/arch/riscv/kernel/sys_hwprobe.c b/arch/riscv/kernel/sys_hwprobe.c
index 0b170e18a2be..12f4b68ad2ac 100644
--- a/arch/riscv/kernel/sys_hwprobe.c
+++ b/arch/riscv/kernel/sys_hwprobe.c
@@ -111,6 +111,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
 		EXT_KEY(ZCA);
 		EXT_KEY(ZCB);
 		EXT_KEY(ZCMOP);
+		EXT_KEY(ZCLSD);
 		EXT_KEY(ZICBOM);
 		EXT_KEY(ZICBOZ);
 		EXT_KEY(ZICNTR);
@@ -119,6 +120,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
 		EXT_KEY(ZIHINTPAUSE);
 		EXT_KEY(ZIHPM);
 		EXT_KEY(ZIMOP);
+		EXT_KEY(ZILSD);
 		EXT_KEY(ZKND);
 		EXT_KEY(ZKNE);
 		EXT_KEY(ZKNH);
-- 
2.39.5


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH v2 4/5] riscv: KVM: allow Zilsd and Zclsd extensions for Guest/VM
  2025-08-26 16:29 [PATCH v2 0/5] Add Zilsd/Zclsd support in hwprobe and KVM Pincheng Wang
                   ` (2 preceding siblings ...)
  2025-08-26 16:29 ` [PATCH v2 3/5] riscv: hwprobe: export Zilsd and Zclsd ISA extensions Pincheng Wang
@ 2025-08-26 16:29 ` Pincheng Wang
  2025-09-01  8:37   ` Nutty.Liu
  2025-08-26 16:29 ` [PATCH v2 5/5] KVM: riscv: selftests: add Zilsd and Zclsd extension to get-reg-list test Pincheng Wang
  4 siblings, 1 reply; 12+ messages in thread
From: Pincheng Wang @ 2025-08-26 16:29 UTC (permalink / raw)
  To: paul.walmsley, palmer, aou, alex, robh, krzk+dt, conor+dt, anup,
	pbonzini, shuah, cyan.yang, cleger, charlie, cuiyunhui,
	samuel.holland, namcao, jesse, inochiama, yongxuan.wang, ajones,
	parri.andrea, mikisabate, yikming2222, thomas.weissschuh
  Cc: linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest, pincheng.plct

Extend the KVM ISA extension ONE_REG interface to allow KVM user space
to detect and enable Zilsd and Zclsd extensions for Guest/VM.

Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
---
 arch/riscv/include/uapi/asm/kvm.h | 2 ++
 arch/riscv/kvm/vcpu_onereg.c      | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/arch/riscv/include/uapi/asm/kvm.h b/arch/riscv/include/uapi/asm/kvm.h
index 5f59fd226cc5..beb7ce06dce8 100644
--- a/arch/riscv/include/uapi/asm/kvm.h
+++ b/arch/riscv/include/uapi/asm/kvm.h
@@ -174,6 +174,8 @@ enum KVM_RISCV_ISA_EXT_ID {
 	KVM_RISCV_ISA_EXT_ZCD,
 	KVM_RISCV_ISA_EXT_ZCF,
 	KVM_RISCV_ISA_EXT_ZCMOP,
+	KVM_RISCV_ISA_EXT_ZCLSD,
+	KVM_RISCV_ISA_EXT_ZILSD,
 	KVM_RISCV_ISA_EXT_ZAWRS,
 	KVM_RISCV_ISA_EXT_SMNPM,
 	KVM_RISCV_ISA_EXT_SSNPM,
diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c
index 2e1b646f0d61..8219769fc4a1 100644
--- a/arch/riscv/kvm/vcpu_onereg.c
+++ b/arch/riscv/kvm/vcpu_onereg.c
@@ -64,6 +64,7 @@ static const unsigned long kvm_isa_ext_arr[] = {
 	KVM_ISA_EXT_ARR(ZCD),
 	KVM_ISA_EXT_ARR(ZCF),
 	KVM_ISA_EXT_ARR(ZCMOP),
+	KVM_ISA_EXT_ARR(ZCLSD),
 	KVM_ISA_EXT_ARR(ZFA),
 	KVM_ISA_EXT_ARR(ZFH),
 	KVM_ISA_EXT_ARR(ZFHMIN),
@@ -78,6 +79,7 @@ static const unsigned long kvm_isa_ext_arr[] = {
 	KVM_ISA_EXT_ARR(ZIHINTPAUSE),
 	KVM_ISA_EXT_ARR(ZIHPM),
 	KVM_ISA_EXT_ARR(ZIMOP),
+	KVM_ISA_EXT_ARR(ZILSD),
 	KVM_ISA_EXT_ARR(ZKND),
 	KVM_ISA_EXT_ARR(ZKNE),
 	KVM_ISA_EXT_ARR(ZKNH),
-- 
2.39.5


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH v2 5/5] KVM: riscv: selftests: add Zilsd and Zclsd extension to get-reg-list test
  2025-08-26 16:29 [PATCH v2 0/5] Add Zilsd/Zclsd support in hwprobe and KVM Pincheng Wang
                   ` (3 preceding siblings ...)
  2025-08-26 16:29 ` [PATCH v2 4/5] riscv: KVM: allow Zilsd and Zclsd extensions for Guest/VM Pincheng Wang
@ 2025-08-26 16:29 ` Pincheng Wang
  2025-09-01  8:37   ` Nutty.Liu
  4 siblings, 1 reply; 12+ messages in thread
From: Pincheng Wang @ 2025-08-26 16:29 UTC (permalink / raw)
  To: paul.walmsley, palmer, aou, alex, robh, krzk+dt, conor+dt, anup,
	pbonzini, shuah, cyan.yang, cleger, charlie, cuiyunhui,
	samuel.holland, namcao, jesse, inochiama, yongxuan.wang, ajones,
	parri.andrea, mikisabate, yikming2222, thomas.weissschuh
  Cc: linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest, pincheng.plct

The KVM RISC-V allows Zilsd and Zclsd extensions for Guest/VM so add
this extension to get-reg-list test.

Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
---
 tools/testing/selftests/kvm/riscv/get-reg-list.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools/testing/selftests/kvm/riscv/get-reg-list.c
index a0b7dabb5040..477bd386265f 100644
--- a/tools/testing/selftests/kvm/riscv/get-reg-list.c
+++ b/tools/testing/selftests/kvm/riscv/get-reg-list.c
@@ -78,7 +78,9 @@ bool filter_reg(__u64 reg)
 	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZCB:
 	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZCD:
 	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZCF:
+	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZCLSD:
 	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZCMOP:
+	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZILSD:
 	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZFA:
 	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZFH:
 	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZFHMIN:
@@ -530,7 +532,9 @@ static const char *isa_ext_single_id_to_str(__u64 reg_off)
 		KVM_ISA_EXT_ARR(ZCB),
 		KVM_ISA_EXT_ARR(ZCD),
 		KVM_ISA_EXT_ARR(ZCF),
+		KVM_ISA_EXT_ARR(ZCLSD),
 		KVM_ISA_EXT_ARR(ZCMOP),
+		KVM_ISA_EXT_ARR(ZILSD),
 		KVM_ISA_EXT_ARR(ZFA),
 		KVM_ISA_EXT_ARR(ZFH),
 		KVM_ISA_EXT_ARR(ZFHMIN),
@@ -1199,7 +1203,9 @@ struct vcpu_reg_list *vcpu_configs[] = {
 	&config_zcb,
 	&config_zcd,
 	&config_zcf,
+	&config_zclsd,
 	&config_zcmop,
+	&config_zilsd,
 	&config_zfa,
 	&config_zfh,
 	&config_zfhmin,
-- 
2.39.5


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2 1/5] dt-bindings: riscv: add Zilsd and Zclsd extension descriptions
  2025-08-26 16:29 ` [PATCH v2 1/5] dt-bindings: riscv: add Zilsd and Zclsd extension descriptions Pincheng Wang
@ 2025-08-26 17:39   ` Conor Dooley
  2025-09-01  8:46   ` Nutty.Liu
  1 sibling, 0 replies; 12+ messages in thread
From: Conor Dooley @ 2025-08-26 17:39 UTC (permalink / raw)
  To: Pincheng Wang
  Cc: paul.walmsley, palmer, aou, alex, robh, krzk+dt, conor+dt, anup,
	pbonzini, shuah, cyan.yang, cleger, charlie, cuiyunhui,
	samuel.holland, namcao, jesse, inochiama, yongxuan.wang, ajones,
	parri.andrea, mikisabate, yikming2222, thomas.weissschuh,
	linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest


[-- Attachment #1.1: Type: text/plain, Size: 454 bytes --]

On Wed, Aug 27, 2025 at 12:29:35AM +0800, Pincheng Wang wrote:
> Add descriptions for the Zilsd (Load/Store pair instructions) and
> Zclsd (Compressed Load/Store pair instructions) ISA extensions
> which were ratified in commit f88abf1 ("Integrating load/store
> pair for RV32 with the main manual") of the riscv-isa-manual.
> 
> Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>

Acked-by: Conor Dooley <conor.dooley@microchip.com>

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2 4/5] riscv: KVM: allow Zilsd and Zclsd extensions for Guest/VM
  2025-08-26 16:29 ` [PATCH v2 4/5] riscv: KVM: allow Zilsd and Zclsd extensions for Guest/VM Pincheng Wang
@ 2025-09-01  8:37   ` Nutty.Liu
  0 siblings, 0 replies; 12+ messages in thread
From: Nutty.Liu @ 2025-09-01  8:37 UTC (permalink / raw)
  To: Pincheng Wang, paul.walmsley, palmer, aou, alex, robh, krzk+dt,
	conor+dt, anup, pbonzini, shuah, cyan.yang, cleger, charlie,
	cuiyunhui, samuel.holland, namcao, jesse, inochiama,
	yongxuan.wang, ajones, parri.andrea, mikisabate, yikming2222,
	thomas.weissschuh
  Cc: linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest


On 8/27/2025 12:29 AM, Pincheng Wang wrote:
> Extend the KVM ISA extension ONE_REG interface to allow KVM user space
> to detect and enable Zilsd and Zclsd extensions for Guest/VM.
>
> Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
> ---
>   arch/riscv/include/uapi/asm/kvm.h | 2 ++
>   arch/riscv/kvm/vcpu_onereg.c      | 2 ++
>   2 files changed, 4 insertions(+)
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>

Thanks.
> diff --git a/arch/riscv/include/uapi/asm/kvm.h b/arch/riscv/include/uapi/asm/kvm.h
> index 5f59fd226cc5..beb7ce06dce8 100644
> --- a/arch/riscv/include/uapi/asm/kvm.h
> +++ b/arch/riscv/include/uapi/asm/kvm.h
> @@ -174,6 +174,8 @@ enum KVM_RISCV_ISA_EXT_ID {
>   	KVM_RISCV_ISA_EXT_ZCD,
>   	KVM_RISCV_ISA_EXT_ZCF,
>   	KVM_RISCV_ISA_EXT_ZCMOP,
> +	KVM_RISCV_ISA_EXT_ZCLSD,
> +	KVM_RISCV_ISA_EXT_ZILSD,
>   	KVM_RISCV_ISA_EXT_ZAWRS,
>   	KVM_RISCV_ISA_EXT_SMNPM,
>   	KVM_RISCV_ISA_EXT_SSNPM,
> diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c
> index 2e1b646f0d61..8219769fc4a1 100644
> --- a/arch/riscv/kvm/vcpu_onereg.c
> +++ b/arch/riscv/kvm/vcpu_onereg.c
> @@ -64,6 +64,7 @@ static const unsigned long kvm_isa_ext_arr[] = {
>   	KVM_ISA_EXT_ARR(ZCD),
>   	KVM_ISA_EXT_ARR(ZCF),
>   	KVM_ISA_EXT_ARR(ZCMOP),
> +	KVM_ISA_EXT_ARR(ZCLSD),
>   	KVM_ISA_EXT_ARR(ZFA),
>   	KVM_ISA_EXT_ARR(ZFH),
>   	KVM_ISA_EXT_ARR(ZFHMIN),
> @@ -78,6 +79,7 @@ static const unsigned long kvm_isa_ext_arr[] = {
>   	KVM_ISA_EXT_ARR(ZIHINTPAUSE),
>   	KVM_ISA_EXT_ARR(ZIHPM),
>   	KVM_ISA_EXT_ARR(ZIMOP),
> +	KVM_ISA_EXT_ARR(ZILSD),
>   	KVM_ISA_EXT_ARR(ZKND),
>   	KVM_ISA_EXT_ARR(ZKNE),
>   	KVM_ISA_EXT_ARR(ZKNH),

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2 5/5] KVM: riscv: selftests: add Zilsd and Zclsd extension to get-reg-list test
  2025-08-26 16:29 ` [PATCH v2 5/5] KVM: riscv: selftests: add Zilsd and Zclsd extension to get-reg-list test Pincheng Wang
@ 2025-09-01  8:37   ` Nutty.Liu
  0 siblings, 0 replies; 12+ messages in thread
From: Nutty.Liu @ 2025-09-01  8:37 UTC (permalink / raw)
  To: Pincheng Wang, paul.walmsley, palmer, aou, alex, robh, krzk+dt,
	conor+dt, anup, pbonzini, shuah, cyan.yang, cleger, charlie,
	cuiyunhui, samuel.holland, namcao, jesse, inochiama,
	yongxuan.wang, ajones, parri.andrea, mikisabate, yikming2222,
	thomas.weissschuh
  Cc: linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest


On 8/27/2025 12:29 AM, Pincheng Wang wrote:
> The KVM RISC-V allows Zilsd and Zclsd extensions for Guest/VM so add
> this extension to get-reg-list test.
>
> Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
> ---
>   tools/testing/selftests/kvm/riscv/get-reg-list.c | 6 ++++++
>   1 file changed, 6 insertions(+)
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>

Thanks.
> diff --git a/tools/testing/selftests/kvm/riscv/get-reg-list.c b/tools/testing/selftests/kvm/riscv/get-reg-list.c
> index a0b7dabb5040..477bd386265f 100644
> --- a/tools/testing/selftests/kvm/riscv/get-reg-list.c
> +++ b/tools/testing/selftests/kvm/riscv/get-reg-list.c
> @@ -78,7 +78,9 @@ bool filter_reg(__u64 reg)
>   	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZCB:
>   	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZCD:
>   	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZCF:
> +	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZCLSD:
>   	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZCMOP:
> +	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZILSD:
>   	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZFA:
>   	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZFH:
>   	case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZFHMIN:
> @@ -530,7 +532,9 @@ static const char *isa_ext_single_id_to_str(__u64 reg_off)
>   		KVM_ISA_EXT_ARR(ZCB),
>   		KVM_ISA_EXT_ARR(ZCD),
>   		KVM_ISA_EXT_ARR(ZCF),
> +		KVM_ISA_EXT_ARR(ZCLSD),
>   		KVM_ISA_EXT_ARR(ZCMOP),
> +		KVM_ISA_EXT_ARR(ZILSD),
>   		KVM_ISA_EXT_ARR(ZFA),
>   		KVM_ISA_EXT_ARR(ZFH),
>   		KVM_ISA_EXT_ARR(ZFHMIN),
> @@ -1199,7 +1203,9 @@ struct vcpu_reg_list *vcpu_configs[] = {
>   	&config_zcb,
>   	&config_zcd,
>   	&config_zcf,
> +	&config_zclsd,
>   	&config_zcmop,
> +	&config_zilsd,
>   	&config_zfa,
>   	&config_zfh,
>   	&config_zfhmin,

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2 3/5] riscv: hwprobe: export Zilsd and Zclsd ISA extensions
  2025-08-26 16:29 ` [PATCH v2 3/5] riscv: hwprobe: export Zilsd and Zclsd ISA extensions Pincheng Wang
@ 2025-09-01  8:39   ` Nutty.Liu
  0 siblings, 0 replies; 12+ messages in thread
From: Nutty.Liu @ 2025-09-01  8:39 UTC (permalink / raw)
  To: Pincheng Wang, paul.walmsley, palmer, aou, alex, robh, krzk+dt,
	conor+dt, anup, pbonzini, shuah, cyan.yang, cleger, charlie,
	cuiyunhui, samuel.holland, namcao, jesse, inochiama,
	yongxuan.wang, ajones, parri.andrea, mikisabate, yikming2222,
	thomas.weissschuh
  Cc: linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest


On 8/27/2025 12:29 AM, Pincheng Wang wrote:
> Export Zilsd and Zclsd ISA extensions through hwprobe.
>
> Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
> ---
>   Documentation/arch/riscv/hwprobe.rst  | 8 ++++++++
>   arch/riscv/include/uapi/asm/hwprobe.h | 2 ++
>   arch/riscv/kernel/sys_hwprobe.c       | 2 ++
>   3 files changed, 12 insertions(+)
>
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>

Thanks.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2 2/5] riscv: add ISA extension parsing for Zilsd and Zclsd
  2025-08-26 16:29 ` [PATCH v2 2/5] riscv: add ISA extension parsing for Zilsd and Zclsd Pincheng Wang
@ 2025-09-01  8:41   ` Nutty.Liu
  0 siblings, 0 replies; 12+ messages in thread
From: Nutty.Liu @ 2025-09-01  8:41 UTC (permalink / raw)
  To: Pincheng Wang, paul.walmsley, palmer, aou, alex, robh, krzk+dt,
	conor+dt, anup, pbonzini, shuah, cyan.yang, cleger, charlie,
	cuiyunhui, samuel.holland, namcao, jesse, inochiama,
	yongxuan.wang, ajones, parri.andrea, mikisabate, yikming2222,
	thomas.weissschuh
  Cc: linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest


On 8/27/2025 12:29 AM, Pincheng Wang wrote:
> Add parsing for Zilsd and Zclsd ISA extensions which were ratified in
> commit f88abf1 ("Integrating load/store pair for RV32 with the
> main manual") of the riscv-isa-manual.
>
> Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
> ---
>   arch/riscv/include/asm/hwcap.h |  2 ++
>   arch/riscv/kernel/cpufeature.c | 24 ++++++++++++++++++++++++
>   2 files changed, 26 insertions(+)
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>

Thanks.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH v2 1/5] dt-bindings: riscv: add Zilsd and Zclsd extension descriptions
  2025-08-26 16:29 ` [PATCH v2 1/5] dt-bindings: riscv: add Zilsd and Zclsd extension descriptions Pincheng Wang
  2025-08-26 17:39   ` Conor Dooley
@ 2025-09-01  8:46   ` Nutty.Liu
  1 sibling, 0 replies; 12+ messages in thread
From: Nutty.Liu @ 2025-09-01  8:46 UTC (permalink / raw)
  To: Pincheng Wang, paul.walmsley, palmer, aou, alex, robh, krzk+dt,
	conor+dt, anup, pbonzini, shuah, cyan.yang, cleger, charlie,
	cuiyunhui, samuel.holland, namcao, jesse, inochiama,
	yongxuan.wang, ajones, parri.andrea, mikisabate, yikming2222,
	thomas.weissschuh
  Cc: linux-riscv, linux-kernel, linux-doc, devicetree, kvm, kvm-riscv,
	linux-kselftest


On 8/27/2025 12:29 AM, Pincheng Wang wrote:
> Add descriptions for the Zilsd (Load/Store pair instructions) and
> Zclsd (Compressed Load/Store pair instructions) ISA extensions
> which were ratified in commit f88abf1 ("Integrating load/store
> pair for RV32 with the main manual") of the riscv-isa-manual.
>
> Signed-off-by: Pincheng Wang <pincheng.plct@isrc.iscas.ac.cn>
> ---
>   .../devicetree/bindings/riscv/extensions.yaml | 36 +++++++++++++++++++
>   1 file changed, 36 insertions(+)
Reviewed-by: Nutty Liu <nutty.liu@hotmail.com>

Thanks.

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2025-09-01  9:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 16:29 [PATCH v2 0/5] Add Zilsd/Zclsd support in hwprobe and KVM Pincheng Wang
2025-08-26 16:29 ` [PATCH v2 1/5] dt-bindings: riscv: add Zilsd and Zclsd extension descriptions Pincheng Wang
2025-08-26 17:39   ` Conor Dooley
2025-09-01  8:46   ` Nutty.Liu
2025-08-26 16:29 ` [PATCH v2 2/5] riscv: add ISA extension parsing for Zilsd and Zclsd Pincheng Wang
2025-09-01  8:41   ` Nutty.Liu
2025-08-26 16:29 ` [PATCH v2 3/5] riscv: hwprobe: export Zilsd and Zclsd ISA extensions Pincheng Wang
2025-09-01  8:39   ` Nutty.Liu
2025-08-26 16:29 ` [PATCH v2 4/5] riscv: KVM: allow Zilsd and Zclsd extensions for Guest/VM Pincheng Wang
2025-09-01  8:37   ` Nutty.Liu
2025-08-26 16:29 ` [PATCH v2 5/5] KVM: riscv: selftests: add Zilsd and Zclsd extension to get-reg-list test Pincheng Wang
2025-09-01  8:37   ` Nutty.Liu

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