]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions
authorClément Léger <cleger@rivosinc.com>
Wed, 19 Jun 2024 11:35:19 +0000 (13:35 +0200)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 26 Jun 2024 14:54:53 +0000 (07:54 -0700)
Export Zca, Zcf, Zcd and Zcb ISA extension through hwprobe.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20240619113529.676940-10-cleger@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Documentation/arch/riscv/hwprobe.rst
arch/riscv/include/uapi/asm/hwprobe.h
arch/riscv/kernel/sys_hwprobe.c

index 2b7f1d05b2e3f3e2400067f4d016f8b25e9da59f..4d9b4ed34c96507f6365fcb0ef73d13a6c159f7f 100644 (file)
@@ -211,6 +211,26 @@ The following keys are defined:
        supported as defined in the RISC-V ISA manual starting from commit
        58220614a5f ("Zimop is ratified/1.0").
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZCA`: The Zca extension part of Zc* standard
+       extensions for code size reduction, as ratified in commit 8be3419c1c0
+       ("Zcf doesn't exist on RV64 as it contains no instructions") of
+       riscv-code-size-reduction.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZCB`: The Zcb extension part of Zc* standard
+       extensions for code size reduction, as ratified in commit 8be3419c1c0
+       ("Zcf doesn't exist on RV64 as it contains no instructions") of
+       riscv-code-size-reduction.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZCD`: The Zcd extension part of Zc* standard
+       extensions for code size reduction, as ratified in commit 8be3419c1c0
+       ("Zcf doesn't exist on RV64 as it contains no instructions") of
+       riscv-code-size-reduction.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZCF`: The Zcf extension part of Zc* standard
+       extensions for code size reduction, as ratified in commit 8be3419c1c0
+       ("Zcf doesn't exist on RV64 as it contains no instructions") of
+       riscv-code-size-reduction.
+
 * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance
   information about the selected set of processors.
 
index 538c404938e60fb67cd5a9b1f6d07979ec69bb4f..c38f3f2b8382fbc3f564cf9c9c2a04c60be3535a 100644 (file)
@@ -66,6 +66,10 @@ struct riscv_hwprobe {
 #define                RISCV_HWPROBE_EXT_ZVE64F        (1ULL << 40)
 #define                RISCV_HWPROBE_EXT_ZVE64D        (1ULL << 41)
 #define                RISCV_HWPROBE_EXT_ZIMOP         (1ULL << 42)
+#define                RISCV_HWPROBE_EXT_ZCA           (1ULL << 43)
+#define                RISCV_HWPROBE_EXT_ZCB           (1ULL << 44)
+#define                RISCV_HWPROBE_EXT_ZCD           (1ULL << 45)
+#define                RISCV_HWPROBE_EXT_ZCF           (1ULL << 46)
 #define RISCV_HWPROBE_KEY_CPUPERF_0    5
 #define                RISCV_HWPROBE_MISALIGNED_UNKNOWN        (0 << 0)
 #define                RISCV_HWPROBE_MISALIGNED_EMULATED       (1 << 0)
index 04a2ed4ee41578d043feb2347c89ebb6cdf69ece..89e03cdf38b73f5ef310fc7a0b6309d5e8ca41d9 100644 (file)
@@ -113,6 +113,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
                EXT_KEY(ZICOND);
                EXT_KEY(ZIHINTPAUSE);
                EXT_KEY(ZIMOP);
+               EXT_KEY(ZCA);
+               EXT_KEY(ZCB);
 
                /*
                 * All the following extensions must depend on the kernel
@@ -142,6 +144,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
                        EXT_KEY(ZFH);
                        EXT_KEY(ZFHMIN);
                        EXT_KEY(ZFA);
+                       EXT_KEY(ZCD);
+                       EXT_KEY(ZCF);
                }
 #undef EXT_KEY
        }