@@ -10,13 +10,13 @@ use super::super::riscv::imply_features;
10
10
use super :: auxvec;
11
11
use crate :: detect:: { Feature , bit, cache} ;
12
12
13
- // See <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/prctl.h?h=v6.14 >
13
+ // See <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/prctl.h?h=v6.15 >
14
14
// for runtime status query constants.
15
15
const PR_RISCV_V_GET_CONTROL : libc:: c_int = 70 ;
16
16
const PR_RISCV_V_VSTATE_CTRL_ON : libc:: c_int = 2 ;
17
17
const PR_RISCV_V_VSTATE_CTRL_CUR_MASK : libc:: c_int = 3 ;
18
18
19
- // See <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/include/uapi/asm/hwprobe.h?h=v6.14 >
19
+ // See <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/include/uapi/asm/hwprobe.h?h=v6.15 >
20
20
// for riscv_hwprobe struct and hardware probing constants.
21
21
22
22
#[ repr( C ) ]
@@ -83,6 +83,14 @@ const RISCV_HWPROBE_EXT_ZCMOP: u64 = 1 << 47;
83
83
const RISCV_HWPROBE_EXT_ZAWRS : u64 = 1 << 48 ;
84
84
// Excluded because it only reports the existence of `prctl`-based pointer masking control.
85
85
// const RISCV_HWPROBE_EXT_SUPM: u64 = 1 << 49;
86
+ const RISCV_HWPROBE_EXT_ZICNTR : u64 = 1 << 50 ;
87
+ const RISCV_HWPROBE_EXT_ZIHPM : u64 = 1 << 51 ;
88
+ const RISCV_HWPROBE_EXT_ZFBFMIN : u64 = 1 << 52 ;
89
+ const RISCV_HWPROBE_EXT_ZVFBFMIN : u64 = 1 << 53 ;
90
+ const RISCV_HWPROBE_EXT_ZVFBFWMA : u64 = 1 << 54 ;
91
+ const RISCV_HWPROBE_EXT_ZICBOM : u64 = 1 << 55 ;
92
+ const RISCV_HWPROBE_EXT_ZAAMO : u64 = 1 << 56 ;
93
+ const RISCV_HWPROBE_EXT_ZALRSC : u64 = 1 << 57 ;
86
94
87
95
const RISCV_HWPROBE_KEY_CPUPERF_0 : i64 = 5 ;
88
96
const RISCV_HWPROBE_MISALIGNED_FAST : u64 = 3 ;
@@ -133,7 +141,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
133
141
// Use auxiliary vector to enable single-letter ISA extensions.
134
142
// The values are part of the platform-specific [asm/hwcap.h][hwcap]
135
143
//
136
- // [hwcap]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/include/uapi/asm/hwcap.h?h=v6.14
144
+ // [hwcap]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/include/uapi/asm/hwcap.h?h=v6.15
137
145
let auxv = auxvec:: auxv ( ) . expect ( "read auxvec" ) ; // should not fail on RISC-V platform
138
146
let mut has_i = bit:: test ( auxv. hwcap , ( b'i' - b'a' ) . into ( ) ) ;
139
147
#[ allow( clippy:: eq_op) ]
@@ -221,12 +229,18 @@ pub(crate) fn detect_features() -> cache::Initializer {
221
229
enable_feature ( Feature :: d, test ( RISCV_HWPROBE_IMA_FD ) ) ; // F is implied.
222
230
enable_feature ( Feature :: c, test ( RISCV_HWPROBE_IMA_C ) ) ;
223
231
232
+ enable_feature ( Feature :: zicntr, test ( RISCV_HWPROBE_EXT_ZICNTR ) ) ;
233
+ enable_feature ( Feature :: zihpm, test ( RISCV_HWPROBE_EXT_ZIHPM ) ) ;
234
+
224
235
enable_feature ( Feature :: zihintntl, test ( RISCV_HWPROBE_EXT_ZIHINTNTL ) ) ;
225
236
enable_feature ( Feature :: zihintpause, test ( RISCV_HWPROBE_EXT_ZIHINTPAUSE ) ) ;
226
237
enable_feature ( Feature :: zimop, test ( RISCV_HWPROBE_EXT_ZIMOP ) ) ;
238
+ enable_feature ( Feature :: zicbom, test ( RISCV_HWPROBE_EXT_ZICBOM ) ) ;
227
239
enable_feature ( Feature :: zicboz, test ( RISCV_HWPROBE_EXT_ZICBOZ ) ) ;
228
240
enable_feature ( Feature :: zicond, test ( RISCV_HWPROBE_EXT_ZICOND ) ) ;
229
241
242
+ enable_feature ( Feature :: zalrsc, test ( RISCV_HWPROBE_EXT_ZALRSC ) ) ;
243
+ enable_feature ( Feature :: zaamo, test ( RISCV_HWPROBE_EXT_ZAAMO ) ) ;
230
244
enable_feature ( Feature :: zawrs, test ( RISCV_HWPROBE_EXT_ZAWRS ) ) ;
231
245
enable_feature ( Feature :: zacas, test ( RISCV_HWPROBE_EXT_ZACAS ) ) ;
232
246
enable_feature ( Feature :: ztso, test ( RISCV_HWPROBE_EXT_ZTSO ) ) ;
@@ -255,6 +269,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
255
269
enable_feature ( Feature :: zfh, test ( RISCV_HWPROBE_EXT_ZFH ) ) ;
256
270
enable_feature ( Feature :: zfhmin, test ( RISCV_HWPROBE_EXT_ZFHMIN ) ) ;
257
271
enable_feature ( Feature :: zfa, test ( RISCV_HWPROBE_EXT_ZFA ) ) ;
272
+ enable_feature ( Feature :: zfbfmin, test ( RISCV_HWPROBE_EXT_ZFBFMIN ) ) ;
258
273
259
274
// Use prctl (if any) to determine whether the vector extension
260
275
// is enabled on the current thread (assuming the entire process
@@ -290,6 +305,8 @@ pub(crate) fn detect_features() -> cache::Initializer {
290
305
291
306
enable_feature ( Feature :: zvfh, test ( RISCV_HWPROBE_EXT_ZVFH ) ) ;
292
307
enable_feature ( Feature :: zvfhmin, test ( RISCV_HWPROBE_EXT_ZVFHMIN ) ) ;
308
+ enable_feature ( Feature :: zvfbfmin, test ( RISCV_HWPROBE_EXT_ZVFBFMIN ) ) ;
309
+ enable_feature ( Feature :: zvfbfwma, test ( RISCV_HWPROBE_EXT_ZVFBFWMA ) ) ;
293
310
}
294
311
is_v_set = true ;
295
312
} ;
0 commit comments