Skip to content

Commit 4458b8f

Browse files
mssolaAlexandre Ghiti
authored andcommitted
riscv: hwprobe: export Zicntr and Zihpm extensions
Export Zicntr and Zihpm ISA extensions through the hwprobe syscall. [ alex: Fix hwprobe numbering ] Signed-off-by: Miquel Sabaté Solà <[email protected]> Acked-by: Jesse Taube <[email protected]> Reviewed-by: Conor Dooley <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Ghiti <[email protected]>
1 parent d3817d0 commit 4458b8f

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

Documentation/arch/riscv/hwprobe.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ The following keys are defined:
183183
defined in the Atomic Compare-and-Swap (CAS) instructions manual starting
184184
from commit 5059e0ca641c ("update to ratified").
185185

186+
* :c:macro:`RISCV_HWPROBE_EXT_ZICNTR`: The Zicntr extension version 2.0
187+
is supported as defined in the RISC-V ISA manual.
188+
186189
* :c:macro:`RISCV_HWPROBE_EXT_ZICOND`: The Zicond extension is supported as
187190
defined in the RISC-V Integer Conditional (Zicond) operations extension
188191
manual starting from commit 95cf1f9 ("Add changes requested by Ved
@@ -192,6 +195,9 @@ The following keys are defined:
192195
supported as defined in the RISC-V ISA manual starting from commit
193196
d8ab5c78c207 ("Zihintpause is ratified").
194197

198+
* :c:macro:`RISCV_HWPROBE_EXT_ZIHPM`: The Zihpm extension version 2.0
199+
is supported as defined in the RISC-V ISA manual.
200+
195201
* :c:macro:`RISCV_HWPROBE_EXT_ZVE32X`: The Vector sub-extension Zve32x is
196202
supported, as defined by version 1.0 of the RISC-V Vector extension manual.
197203

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ 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_ZICNTR (1ULL << 50)
77+
#define RISCV_HWPROBE_EXT_ZIHPM (1ULL << 51)
7678
#define RISCV_HWPROBE_KEY_CPUPERF_0 5
7779
#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
7880
#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
@@ -108,9 +108,11 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
108108
EXT_KEY(ZCB);
109109
EXT_KEY(ZCMOP);
110110
EXT_KEY(ZICBOZ);
111+
EXT_KEY(ZICNTR);
111112
EXT_KEY(ZICOND);
112113
EXT_KEY(ZIHINTNTL);
113114
EXT_KEY(ZIHINTPAUSE);
115+
EXT_KEY(ZIHPM);
114116
EXT_KEY(ZIMOP);
115117
EXT_KEY(ZKND);
116118
EXT_KEY(ZKNE);

0 commit comments

Comments
 (0)