]> Git Repo - linux.git/commitdiff
riscv: hwprobe: export Zihintpause ISA extension
authorClément Léger <[email protected]>
Wed, 21 Feb 2024 08:31:06 +0000 (09:31 +0100)
committerPalmer Dabbelt <[email protected]>
Sun, 28 Apr 2024 21:50:38 +0000 (14:50 -0700)
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]>
Documentation/arch/riscv/hwprobe.rst
arch/riscv/include/uapi/asm/hwprobe.h
arch/riscv/kernel/sys_hwprobe.c

index b2bcc9eed9aa9d5e004b562a1741e6b387a82050..204cd4433af5bee8734979351520c46bf3453d84 100644 (file)
@@ -188,6 +188,10 @@ The following keys are defined:
        manual starting from commit 95cf1f9 ("Add changes requested by Ved
        during signoff")
 
+  * :c:macro:`RISCV_HWPROBE_EXT_ZIHINTPAUSE`: The Zihintpause extension is
+       supported as defined in the RISC-V ISA manual starting from commit
+       d8ab5c78c207 ("Zihintpause is ratified").
+
 * :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance
   information about the selected set of processors.
 
index 9f2a8e3ff2048e78201e188a5fc832a67429a06c..31c570cbd1c5847c23fad7423a26b3e55849609d 100644 (file)
@@ -59,6 +59,7 @@ struct riscv_hwprobe {
 #define                RISCV_HWPROBE_EXT_ZTSO          (1ULL << 33)
 #define                RISCV_HWPROBE_EXT_ZACAS         (1ULL << 34)
 #define                RISCV_HWPROBE_EXT_ZICOND        (1ULL << 35)
+#define                RISCV_HWPROBE_EXT_ZIHINTPAUSE   (1ULL << 36)
 #define RISCV_HWPROBE_KEY_CPUPERF_0    5
 #define                RISCV_HWPROBE_MISALIGNED_UNKNOWN        (0 << 0)
 #define                RISCV_HWPROBE_MISALIGNED_EMULATED       (1 << 0)
index 8cae41a502dd4a9e9c3a23c3a63d998c3e9de2d3..969ef3d59dbe0098b91e614cf771a0df9d5e1421 100644 (file)
@@ -111,6 +111,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
                EXT_KEY(ZTSO);
                EXT_KEY(ZACAS);
                EXT_KEY(ZICOND);
+               EXT_KEY(ZIHINTPAUSE);
 
                if (has_vector()) {
                        EXT_KEY(ZVBB);
This page took 0.064076 seconds and 4 git commands to generate.