Skip to content

Commit de8f828

Browse files
AndybnACTpalmer-dabbelt
authored andcommitted
riscv: hwprobe: add zve Vector subextensions into hwprobe interface
The following Vector subextensions for "embedded" platforms are added into RISCV_HWPROBE_KEY_IMA_EXT_0: - ZVE32X - ZVE32F - ZVE64X - ZVE64F - ZVE64D Extensions ending with an X indicates that the platform doesn't have a vector FPU. Extensions ending with F/D mean that whether single (F) or double (D) precision vector operation is supported. The number 32 or 64 follows from ZVE tells the maximum element length. Signed-off-by: Andy Chiu <[email protected]> Reviewed-by: Clément Léger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 1e74835 commit de8f828

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

Documentation/arch/riscv/hwprobe.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,21 @@ The following keys are defined:
192192
supported as defined in the RISC-V ISA manual starting from commit
193193
d8ab5c78c207 ("Zihintpause is ratified").
194194

195+
* :c:macro:`RISCV_HWPROBE_EXT_ZVE32X`: The Vector sub-extension Zve32x is
196+
supported, as defined by version 1.0 of the RISC-V Vector extension manual.
197+
198+
* :c:macro:`RISCV_HWPROBE_EXT_ZVE32F`: The Vector sub-extension Zve32f is
199+
supported, as defined by version 1.0 of the RISC-V Vector extension manual.
200+
201+
* :c:macro:`RISCV_HWPROBE_EXT_ZVE64X`: The Vector sub-extension Zve64x is
202+
supported, as defined by version 1.0 of the RISC-V Vector extension manual.
203+
204+
* :c:macro:`RISCV_HWPROBE_EXT_ZVE64F`: The Vector sub-extension Zve64f is
205+
supported, as defined by version 1.0 of the RISC-V Vector extension manual.
206+
207+
* :c:macro:`RISCV_HWPROBE_EXT_ZVE64D`: The Vector sub-extension Zve64d is
208+
supported, as defined by version 1.0 of the RISC-V Vector extension manual.
209+
195210
* :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance
196211
information about the selected set of processors.
197212

arch/riscv/include/uapi/asm/hwprobe.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ struct riscv_hwprobe {
6060
#define RISCV_HWPROBE_EXT_ZACAS (1ULL << 34)
6161
#define RISCV_HWPROBE_EXT_ZICOND (1ULL << 35)
6262
#define RISCV_HWPROBE_EXT_ZIHINTPAUSE (1ULL << 36)
63+
#define RISCV_HWPROBE_EXT_ZVE32X (1ULL << 37)
64+
#define RISCV_HWPROBE_EXT_ZVE32F (1ULL << 38)
65+
#define RISCV_HWPROBE_EXT_ZVE64X (1ULL << 39)
66+
#define RISCV_HWPROBE_EXT_ZVE64F (1ULL << 40)
67+
#define RISCV_HWPROBE_EXT_ZVE64D (1ULL << 41)
6368
#define RISCV_HWPROBE_KEY_CPUPERF_0 5
6469
#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
6570
#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)

arch/riscv/kernel/sys_hwprobe.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
114114
EXT_KEY(ZIHINTPAUSE);
115115

116116
if (has_vector()) {
117+
EXT_KEY(ZVE32X);
118+
EXT_KEY(ZVE32F);
119+
EXT_KEY(ZVE64X);
120+
EXT_KEY(ZVE64F);
121+
EXT_KEY(ZVE64D);
117122
EXT_KEY(ZVBB);
118123
EXT_KEY(ZVBC);
119124
EXT_KEY(ZVKB);

0 commit comments

Comments
 (0)