@@ -10,13 +10,13 @@ use super::super::riscv::imply_features;
1010use super :: auxvec;
1111use crate :: detect:: { Feature , bit, cache} ;
1212
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 >
1414// for runtime status query constants.
1515const PR_RISCV_V_GET_CONTROL : libc:: c_int = 70 ;
1616const PR_RISCV_V_VSTATE_CTRL_ON : libc:: c_int = 2 ;
1717const PR_RISCV_V_VSTATE_CTRL_CUR_MASK : libc:: c_int = 3 ;
1818
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 >
2020// for riscv_hwprobe struct and hardware probing constants.
2121
2222#[ repr( C ) ]
@@ -83,6 +83,14 @@ const RISCV_HWPROBE_EXT_ZCMOP: u64 = 1 << 47;
8383const RISCV_HWPROBE_EXT_ZAWRS : u64 = 1 << 48 ;
8484// Excluded because it only reports the existence of `prctl`-based pointer masking control.
8585// 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 ;
8694
8795const RISCV_HWPROBE_KEY_CPUPERF_0 : i64 = 5 ;
8896const RISCV_HWPROBE_MISALIGNED_FAST : u64 = 3 ;
@@ -133,7 +141,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
133141 // Use auxiliary vector to enable single-letter ISA extensions.
134142 // The values are part of the platform-specific [asm/hwcap.h][hwcap]
135143 //
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
137145 let auxv = auxvec:: auxv ( ) . expect ( "read auxvec" ) ; // should not fail on RISC-V platform
138146 let mut has_i = bit:: test ( auxv. hwcap , ( b'i' - b'a' ) . into ( ) ) ;
139147 #[ allow( clippy:: eq_op) ]
@@ -221,12 +229,18 @@ pub(crate) fn detect_features() -> cache::Initializer {
221229 enable_feature ( Feature :: d, test ( RISCV_HWPROBE_IMA_FD ) ) ; // F is implied.
222230 enable_feature ( Feature :: c, test ( RISCV_HWPROBE_IMA_C ) ) ;
223231
232+ enable_feature ( Feature :: zicntr, test ( RISCV_HWPROBE_EXT_ZICNTR ) ) ;
233+ enable_feature ( Feature :: zihpm, test ( RISCV_HWPROBE_EXT_ZIHPM ) ) ;
234+
224235 enable_feature ( Feature :: zihintntl, test ( RISCV_HWPROBE_EXT_ZIHINTNTL ) ) ;
225236 enable_feature ( Feature :: zihintpause, test ( RISCV_HWPROBE_EXT_ZIHINTPAUSE ) ) ;
226237 enable_feature ( Feature :: zimop, test ( RISCV_HWPROBE_EXT_ZIMOP ) ) ;
238+ enable_feature ( Feature :: zicbom, test ( RISCV_HWPROBE_EXT_ZICBOM ) ) ;
227239 enable_feature ( Feature :: zicboz, test ( RISCV_HWPROBE_EXT_ZICBOZ ) ) ;
228240 enable_feature ( Feature :: zicond, test ( RISCV_HWPROBE_EXT_ZICOND ) ) ;
229241
242+ enable_feature ( Feature :: zalrsc, test ( RISCV_HWPROBE_EXT_ZALRSC ) ) ;
243+ enable_feature ( Feature :: zaamo, test ( RISCV_HWPROBE_EXT_ZAAMO ) ) ;
230244 enable_feature ( Feature :: zawrs, test ( RISCV_HWPROBE_EXT_ZAWRS ) ) ;
231245 enable_feature ( Feature :: zacas, test ( RISCV_HWPROBE_EXT_ZACAS ) ) ;
232246 enable_feature ( Feature :: ztso, test ( RISCV_HWPROBE_EXT_ZTSO ) ) ;
@@ -255,6 +269,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
255269 enable_feature ( Feature :: zfh, test ( RISCV_HWPROBE_EXT_ZFH ) ) ;
256270 enable_feature ( Feature :: zfhmin, test ( RISCV_HWPROBE_EXT_ZFHMIN ) ) ;
257271 enable_feature ( Feature :: zfa, test ( RISCV_HWPROBE_EXT_ZFA ) ) ;
272+ enable_feature ( Feature :: zfbfmin, test ( RISCV_HWPROBE_EXT_ZFBFMIN ) ) ;
258273
259274 // Use prctl (if any) to determine whether the vector extension
260275 // is enabled on the current thread (assuming the entire process
@@ -290,6 +305,8 @@ pub(crate) fn detect_features() -> cache::Initializer {
290305
291306 enable_feature ( Feature :: zvfh, test ( RISCV_HWPROBE_EXT_ZVFH ) ) ;
292307 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 ) ) ;
293310 }
294311 is_v_set = true ;
295312 } ;
0 commit comments