]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
riscv/hwprobe: add zicfilp / zicfiss enumeration in hwprobe
authorDeepak Gupta <debug@rivosinc.com>
Mon, 26 Jan 2026 04:09:55 +0000 (21:09 -0700)
committerPaul Walmsley <pjw@kernel.org>
Thu, 29 Jan 2026 09:38:40 +0000 (02:38 -0700)
Add enumeration of the zicfilp and zicfiss extensions in the hwprobe syscall.

Reviewed-by: Zong Li <zong.li@sifive.com>
Signed-off-by: Deepak Gupta <debug@rivosinc.com>
Tested-by: Andreas Korb <andreas.korb@aisec.fraunhofer.de> # QEMU, custom CVA6
Tested-by: Valentin Haudiquet <valentin.haudiquet@canonical.com>
Link: https://patch.msgid.link/20251112-v5_user_cfi_series-v23-20-b55691eacf4f@rivosinc.com
[pjw@kernel.org: updated to apply; extend into RISCV_HWPROBE_KEY_IMA_EXT_1; clean patch description]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/include/uapi/asm/hwprobe.h
arch/riscv/kernel/sys_hwprobe.c

index ed2621a5a47d5d362914c918facb973355150f01..9139edba0aecbf466098ace486658aaeeb6667e3 100644 (file)
@@ -86,6 +86,7 @@ struct riscv_hwprobe {
 #define                RISCV_HWPROBE_EXT_ZICBOP        (1ULL << 60)
 #define                RISCV_HWPROBE_EXT_ZILSD         (1ULL << 61)
 #define                RISCV_HWPROBE_EXT_ZCLSD         (1ULL << 62)
+#define                RISCV_HWPROBE_EXT_ZICFILP       (1ULL << 63)
 
 #define RISCV_HWPROBE_KEY_CPUPERF_0    5
 #define                RISCV_HWPROBE_MISALIGNED_UNKNOWN        (0 << 0)
@@ -114,6 +115,8 @@ struct riscv_hwprobe {
 #define RISCV_HWPROBE_KEY_VENDOR_EXT_MIPS_0    14
 #define RISCV_HWPROBE_KEY_ZICBOP_BLOCK_SIZE    15
 #define RISCV_HWPROBE_KEY_IMA_EXT_1            16
+#define                RISCV_HWPROBE_EXT_ZICFISS       (1ULL << 0)
+
 /* Increase RISCV_HWPROBE_MAX_KEY when adding items. */
 
 /* Flags */
index 53731ace7984abcd9eba89260152caa5718cc9f7..1659d31fd288fc296d711c111e8d1a2e2fc8026a 100644 (file)
@@ -126,6 +126,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
                EXT_KEY(isainfo->isa, ZICBOM, pair->value, missing);
                EXT_KEY(isainfo->isa, ZICBOP, pair->value, missing);
                EXT_KEY(isainfo->isa, ZICBOZ, pair->value, missing);
+               EXT_KEY(isainfo->isa, ZICFILP, pair->value, missing);
                EXT_KEY(isainfo->isa, ZICNTR, pair->value, missing);
                EXT_KEY(isainfo->isa, ZICOND, pair->value, missing);
                EXT_KEY(isainfo->isa, ZIHINTNTL, pair->value, missing);
@@ -195,7 +196,7 @@ static void hwprobe_isa_ext1(struct riscv_hwprobe *pair,
         * doesn't have.
         */
        for_each_cpu(cpu, cpus) {
-               /* struct riscv_isainfo *isainfo = &hart_isa[cpu]; */
+               struct riscv_isainfo *isainfo = &hart_isa[cpu];
 
                /*
                 * Only use EXT_KEY() for extensions which can be
@@ -203,7 +204,7 @@ static void hwprobe_isa_ext1(struct riscv_hwprobe *pair,
                 * configuration, as no other checks, besides presence
                 * in the hart_isa bitmap, are made.
                 */
-               /* Nothing here yet */
+               EXT_KEY(isainfo->isa, ZICFISS, pair->value, missing);
        }
 
        /* Now turn off reporting features if any CPU is missing it. */