Skip to content

Commit 63f93a3

Browse files
clementlegerpalmer-dabbelt
authored andcommitted
riscv: hwprobe: export Zihintpause ISA extension
Export the Zihintpause ISA extension through hwprobe which allows using "pause" instructions. Some userspace applications (OpenJDK for instance) uses this to handle some locking back-off. Signed-off-by: Clément Léger <[email protected]> Reviewed-by: Atish Patra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 4413815 commit 63f93a3

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

Documentation/arch/riscv/hwprobe.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,10 @@ The following keys are defined:
188188
manual starting from commit 95cf1f9 ("Add changes requested by Ved
189189
during signoff")
190190

191+
* :c:macro:`RISCV_HWPROBE_EXT_ZIHINTPAUSE`: The Zihintpause extension is
192+
supported as defined in the RISC-V ISA manual starting from commit
193+
d8ab5c78c207 ("Zihintpause is ratified").
194+
191195
* :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance
192196
information about the selected set of processors.
193197

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ struct riscv_hwprobe {
5959
#define RISCV_HWPROBE_EXT_ZTSO (1ULL << 33)
6060
#define RISCV_HWPROBE_EXT_ZACAS (1ULL << 34)
6161
#define RISCV_HWPROBE_EXT_ZICOND (1ULL << 35)
62+
#define RISCV_HWPROBE_EXT_ZIHINTPAUSE (1ULL << 36)
6263
#define RISCV_HWPROBE_KEY_CPUPERF_0 5
6364
#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
6465
#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)

arch/riscv/kernel/sys_hwprobe.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
111111
EXT_KEY(ZTSO);
112112
EXT_KEY(ZACAS);
113113
EXT_KEY(ZICOND);
114+
EXT_KEY(ZIHINTPAUSE);
114115

115116
if (has_vector()) {
116117
EXT_KEY(ZVBB);

0 commit comments

Comments
 (0)