Skip to content

Commit 30c3099

Browse files
deepak0414Paul Walmsley
authored andcommitted
riscv/hwprobe: add zicfilp / zicfiss enumeration in hwprobe
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>
1 parent 462a94f commit 30c3099

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ struct riscv_hwprobe {
8686
#define RISCV_HWPROBE_EXT_ZICBOP (1ULL << 60)
8787
#define RISCV_HWPROBE_EXT_ZILSD (1ULL << 61)
8888
#define RISCV_HWPROBE_EXT_ZCLSD (1ULL << 62)
89+
#define RISCV_HWPROBE_EXT_ZICFILP (1ULL << 63)
8990

9091
#define RISCV_HWPROBE_KEY_CPUPERF_0 5
9192
#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
@@ -114,6 +115,8 @@ struct riscv_hwprobe {
114115
#define RISCV_HWPROBE_KEY_VENDOR_EXT_MIPS_0 14
115116
#define RISCV_HWPROBE_KEY_ZICBOP_BLOCK_SIZE 15
116117
#define RISCV_HWPROBE_KEY_IMA_EXT_1 16
118+
#define RISCV_HWPROBE_EXT_ZICFISS (1ULL << 0)
119+
117120
/* Increase RISCV_HWPROBE_MAX_KEY when adding items. */
118121

119122
/* Flags */

arch/riscv/kernel/sys_hwprobe.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
126126
EXT_KEY(isainfo->isa, ZICBOM, pair->value, missing);
127127
EXT_KEY(isainfo->isa, ZICBOP, pair->value, missing);
128128
EXT_KEY(isainfo->isa, ZICBOZ, pair->value, missing);
129+
EXT_KEY(isainfo->isa, ZICFILP, pair->value, missing);
129130
EXT_KEY(isainfo->isa, ZICNTR, pair->value, missing);
130131
EXT_KEY(isainfo->isa, ZICOND, pair->value, missing);
131132
EXT_KEY(isainfo->isa, ZIHINTNTL, pair->value, missing);
@@ -195,15 +196,15 @@ static void hwprobe_isa_ext1(struct riscv_hwprobe *pair,
195196
* doesn't have.
196197
*/
197198
for_each_cpu(cpu, cpus) {
198-
/* struct riscv_isainfo *isainfo = &hart_isa[cpu]; */
199+
struct riscv_isainfo *isainfo = &hart_isa[cpu];
199200

200201
/*
201202
* Only use EXT_KEY() for extensions which can be
202203
* exposed to userspace, regardless of the kernel's
203204
* configuration, as no other checks, besides presence
204205
* in the hart_isa bitmap, are made.
205206
*/
206-
/* Nothing here yet */
207+
EXT_KEY(isainfo->isa, ZICFISS, pair->value, missing);
207208
}
208209

209210
/* Now turn off reporting features if any CPU is missing it. */

0 commit comments

Comments
 (0)