Skip to content

Commit 0ad70db

Browse files
clementlegerpalmer-dabbelt
authored andcommitted
riscv: hwprobe: export Zca, Zcf, Zcd and Zcb ISA extensions
Export Zca, Zcf, Zcd and Zcb ISA extension through hwprobe. Signed-off-by: Clément Léger <[email protected]> Reviewed-by: Charlie Jenkins <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent ba4cd85 commit 0ad70db

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

Documentation/arch/riscv/hwprobe.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,26 @@ The following keys are defined:
211211
supported as defined in the RISC-V ISA manual starting from commit
212212
58220614a5f ("Zimop is ratified/1.0").
213213

214+
* :c:macro:`RISCV_HWPROBE_EXT_ZCA`: The Zca extension part of Zc* standard
215+
extensions for code size reduction, as ratified in commit 8be3419c1c0
216+
("Zcf doesn't exist on RV64 as it contains no instructions") of
217+
riscv-code-size-reduction.
218+
219+
* :c:macro:`RISCV_HWPROBE_EXT_ZCB`: The Zcb extension part of Zc* standard
220+
extensions for code size reduction, as ratified in commit 8be3419c1c0
221+
("Zcf doesn't exist on RV64 as it contains no instructions") of
222+
riscv-code-size-reduction.
223+
224+
* :c:macro:`RISCV_HWPROBE_EXT_ZCD`: The Zcd extension part of Zc* standard
225+
extensions for code size reduction, as ratified in commit 8be3419c1c0
226+
("Zcf doesn't exist on RV64 as it contains no instructions") of
227+
riscv-code-size-reduction.
228+
229+
* :c:macro:`RISCV_HWPROBE_EXT_ZCF`: The Zcf extension part of Zc* standard
230+
extensions for code size reduction, as ratified in commit 8be3419c1c0
231+
("Zcf doesn't exist on RV64 as it contains no instructions") of
232+
riscv-code-size-reduction.
233+
214234
* :c:macro:`RISCV_HWPROBE_KEY_CPUPERF_0`: A bitmask that contains performance
215235
information about the selected set of processors.
216236

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ struct riscv_hwprobe {
6666
#define RISCV_HWPROBE_EXT_ZVE64F (1ULL << 40)
6767
#define RISCV_HWPROBE_EXT_ZVE64D (1ULL << 41)
6868
#define RISCV_HWPROBE_EXT_ZIMOP (1ULL << 42)
69+
#define RISCV_HWPROBE_EXT_ZCA (1ULL << 43)
70+
#define RISCV_HWPROBE_EXT_ZCB (1ULL << 44)
71+
#define RISCV_HWPROBE_EXT_ZCD (1ULL << 45)
72+
#define RISCV_HWPROBE_EXT_ZCF (1ULL << 46)
6973
#define RISCV_HWPROBE_KEY_CPUPERF_0 5
7074
#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0)
7175
#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0)

arch/riscv/kernel/sys_hwprobe.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
113113
EXT_KEY(ZICOND);
114114
EXT_KEY(ZIHINTPAUSE);
115115
EXT_KEY(ZIMOP);
116+
EXT_KEY(ZCA);
117+
EXT_KEY(ZCB);
116118

117119
/*
118120
* All the following extensions must depend on the kernel
@@ -142,6 +144,8 @@ static void hwprobe_isa_ext0(struct riscv_hwprobe *pair,
142144
EXT_KEY(ZFH);
143145
EXT_KEY(ZFHMIN);
144146
EXT_KEY(ZFA);
147+
EXT_KEY(ZCD);
148+
EXT_KEY(ZCF);
145149
}
146150
#undef EXT_KEY
147151
}

0 commit comments

Comments
 (0)