Skip to content

Commit a4863e0

Browse files
inochisaAlexandre Ghiti
authored andcommitted
riscv: hwprobe: export bfloat16 ISA extension
Export Zfbmin, Zvfbfmin, Zvfbfwma ISA extension through hwprobe. Signed-off-by: Inochi Amaoto <[email protected]> Reviewed-by: Clément Léger <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Ghiti <[email protected]>
1 parent e186c28 commit a4863e0

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

Documentation/arch/riscv/hwprobe.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,18 @@ The following keys are defined:
242242
* :c:macro:`RISCV_HWPROBE_EXT_SUPM`: The Supm extension is supported as
243243
defined in version 1.0 of the RISC-V Pointer Masking extensions.
244244

245+
* :c:macro:`RISCV_HWPROBE_EXT_ZFBFMIN`: The Zfbfmin extension is supported as
246+
defined in the RISC-V ISA manual starting from commit 4dc23d6229de
247+
("Added Chapter title to BF16").
248+
249+
* :c:macro:`RISCV_HWPROBE_EXT_ZVFBFMIN`: The Zvfbfmin extension is supported as
250+
defined in the RISC-V ISA manual starting from commit 4dc23d6229de
251+
("Added Chapter title to BF16").
252+
253+
* :c:macro:`RISCV_HWPROBE_EXT_ZVFBFWMA`: The Zvfbfwma extension is supported as
254+
defined in the RISC-V ISA manual starting from commit 4dc23d6229de
255+
("Added Chapter title to BF16").
256+
245257
* :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: Deprecated. Returns similar values to
246258
:c:macro:`RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF`, but the key was
247259
mistakenly classified as a bitmask rather than a value.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ struct riscv_hwprobe {
7373
#define RISCV_HWPROBE_EXT_ZCMOP (1ULL << 47)
7474
#define RISCV_HWPROBE_EXT_ZAWRS (1ULL << 48)
7575
#define RISCV_HWPROBE_EXT_SUPM (1ULL << 49)
76+
#define RISCV_HWPROBE_EXT_ZFBFMIN (1ULL << 50)
77+
#define RISCV_HWPROBE_EXT_ZVFBFMIN (1ULL << 51)
78+
#define RISCV_HWPROBE_EXT_ZVFBFWMA (1ULL << 52)
7679
#define RISCV_HWPROBE_KEY_CPUPERF_0 5
7780
#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
7881
#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)

arch/riscv/kernel/sys_hwprobe.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
131131
EXT_KEY(ZVE64D);
132132
EXT_KEY(ZVE64F);
133133
EXT_KEY(ZVE64X);
134+
EXT_KEY(ZVFBFMIN);
135+
EXT_KEY(ZVFBFWMA);
134136
EXT_KEY(ZVFH);
135137
EXT_KEY(ZVFHMIN);
136138
EXT_KEY(ZVKB);
@@ -147,6 +149,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
147149
EXT_KEY(ZCD);
148150
EXT_KEY(ZCF);
149151
EXT_KEY(ZFA);
152+
EXT_KEY(ZFBFMIN);
150153
EXT_KEY(ZFH);
151154
EXT_KEY(ZFHMIN);
152155
}

0 commit comments

Comments
 (0)