riscv: hwprobe: add support for scalar crypto ISA extensions
authorClément Léger <cleger@rivosinc.com>
Tue, 14 Nov 2023 14:12:40 +0000 (09:12 -0500)
committerPalmer Dabbelt <palmer@rivosinc.com>
Tue, 12 Dec 2023 23:45:01 +0000 (15:45 -0800)
Export the following scalar crypto extensions through hwprobe:

- Zbkb
- Zbkc
- Zbkx
- Zknd
- Zkne
- Zknh
- Zksed
- Zksh
- Zkt

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Link: https://lore.kernel.org/r/20231114141256.126749-5-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_riscv.c

index 3f71da935a6570fbc64336724822c24d6238e649..3a18a31e32c3659de06da806d9f2ec05e62b9534 100644 (file)
@@ -83,6 +83,33 @@ The following keys are defined:
   * :c:macro:`RISCV_HWPROBE_EXT_ZBC` The Zbc extension is supported, as defined
        in version 1.0 of the Bit-Manipulation ISA extensions.
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZBKB` The Zbkb extension is supported, as
+       defined in version 1.0 of the Scalar Crypto ISA extensions.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZBKC` The Zbkc extension is supported, as
+       defined in version 1.0 of the Scalar Crypto ISA extensions.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZBKX` The Zbkx extension is supported, as
+       defined in version 1.0 of the Scalar Crypto ISA extensions.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZKND` The Zknd extension is supported, as
+       defined in version 1.0 of the Scalar Crypto ISA extensions.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZKNE` The Zkne extension is supported, as
+       defined in version 1.0 of the Scalar Crypto ISA extensions.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZKNH` The Zknh extension is supported, as
+       defined in version 1.0 of the Scalar Crypto ISA extensions.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZKSED` The Zksed extension is supported, as
+       defined in version 1.0 of the Scalar Crypto ISA extensions.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZKSH` The Zksh extension is supported, as
+       defined in version 1.0 of the Scalar Crypto ISA extensions.
+
+  * :c:macro:`RISCV_HWPROBE_EXT_ZKT` The Zkt extension is supported, as defined
+       in version 1.0 of the Scalar Crypto ISA extensions.
+
 * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance
   information about the selected set of processors.
 
index aca5abc7ebee5b97738f585d83f10f854555a917..624abd5cde2935d46809a8e0de85e72e27456826 100644 (file)
@@ -31,6 +31,15 @@ struct riscv_hwprobe {
 #define                RISCV_HWPROBE_EXT_ZBS           (1 << 5)
 #define                RISCV_HWPROBE_EXT_ZICBOZ        (1 << 6)
 #define                RISCV_HWPROBE_EXT_ZBC           (1 << 7)
+#define                RISCV_HWPROBE_EXT_ZBKB          (1 << 8)
+#define                RISCV_HWPROBE_EXT_ZBKC          (1 << 9)
+#define                RISCV_HWPROBE_EXT_ZBKX          (1 << 10)
+#define                RISCV_HWPROBE_EXT_ZKND          (1 << 11)
+#define                RISCV_HWPROBE_EXT_ZKNE          (1 << 12)
+#define                RISCV_HWPROBE_EXT_ZKNH          (1 << 13)
+#define                RISCV_HWPROBE_EXT_ZKSED         (1 << 14)
+#define                RISCV_HWPROBE_EXT_ZKSH          (1 << 15)
+#define                RISCV_HWPROBE_EXT_ZKT           (1 << 16)
 #define RISCV_HWPROBE_KEY_CPUPERF_0    5
 #define                RISCV_HWPROBE_MISALIGNED_UNKNOWN        (0 << 0)
 #define                RISCV_HWPROBE_MISALIGNED_EMULATED       (1 << 0)
index 7a40145e96285dd4a5af77a4b23bec8dc1dd1a0c..43aa66e71418ef5a9978cfa2835dc7a92089ab9f 100644 (file)
@@ -163,6 +163,16 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
                EXT_KEY(ZBS);
                EXT_KEY(ZICBOZ);
                EXT_KEY(ZBC);
+
+               EXT_KEY(ZBKB);
+               EXT_KEY(ZBKC);
+               EXT_KEY(ZBKX);
+               EXT_KEY(ZKND);
+               EXT_KEY(ZKNE);
+               EXT_KEY(ZKNH);
+               EXT_KEY(ZKSED);
+               EXT_KEY(ZKSH);
+               EXT_KEY(ZKT);
 #undef EXT_KEY
        }