Skip to content

Commit 9d45d1f

Browse files
clementlegerAlexandre Ghiti
authored andcommitted
riscv: hwprobe: export Zaamo and Zalrsc extensions
Export the Zaamo and Zalrsc extensions to userspace using hwprobe. Signed-off-by: Clément Léger <cleger@rivosinc.com> Reviewed-by: Charlie Jenkins <charlie@rivosinc.com> Link: https://lore.kernel.org/r/20240619153913.867263-4-cleger@rivosinc.com Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
1 parent 35173b6 commit 9d45d1f

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

Documentation/arch/riscv/hwprobe.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,14 @@ The following keys are defined:
245245
ratified in commit 98918c844281 ("Merge pull request #1217 from
246246
riscv/zawrs") of riscv-isa-manual.
247247

248+
* :c:macro:`RISCV_HWPROBE_EXT_ZAAMO`: The Zaamo extension is supported as
249+
defined in the in the RISC-V ISA manual starting from commit e87412e621f1
250+
("integrate Zaamo and Zalrsc text (#1304)").
251+
252+
* :c:macro:`RISCV_HWPROBE_EXT_ZALRSC`: The Zalrsc extension is supported as
253+
defined in the in the RISC-V ISA manual starting from commit e87412e621f1
254+
("integrate Zaamo and Zalrsc text (#1304)").
255+
248256
* :c:macro:`RISCV_HWPROBE_EXT_SUPM`: The Supm extension is supported as
249257
defined in version 1.0 of the RISC-V Pointer Masking extensions.
250258

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ struct riscv_hwprobe {
7979
#define RISCV_HWPROBE_EXT_ZVFBFMIN (1ULL << 53)
8080
#define RISCV_HWPROBE_EXT_ZVFBFWMA (1ULL << 54)
8181
#define RISCV_HWPROBE_EXT_ZICBOM (1ULL << 55)
82+
#define RISCV_HWPROBE_EXT_ZAAMO (1ULL << 56)
83+
#define RISCV_HWPROBE_EXT_ZALRSC (1ULL << 57)
8284
#define RISCV_HWPROBE_KEY_CPUPERF_0 5
8385
#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
8486
#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)

arch/riscv/kernel/sys_hwprobe.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
9595
* regardless of the kernel's configuration, as no other checks, besides
9696
* presence in the hart_isa bitmap, are made.
9797
*/
98+
EXT_KEY(ZAAMO);
9899
EXT_KEY(ZACAS);
100+
EXT_KEY(ZALRSC);
99101
EXT_KEY(ZAWRS);
100102
EXT_KEY(ZBA);
101103
EXT_KEY(ZBB);

0 commit comments

Comments
 (0)