7 This document describes the usage and semantics of the arm64 ELF hwcaps.
13 Some hardware or software features are only available on some CPU
14 implementations, and/or with certain kernel configurations, but have no
15 architected discovery mechanism available to userspace code at EL0. The
16 kernel exposes the presence of these features to userspace through a set
17 of flags called hwcaps, exposed in the auxilliary vector.
19 Userspace software can test for features by acquiring the AT_HWCAP or
20 AT_HWCAP2 entry of the auxiliary vector, and testing whether the relevant
23 bool floating_point_is_present(void)
25 unsigned long hwcaps = getauxval(AT_HWCAP);
26 if (hwcaps & HWCAP_FP)
32 Where software relies on a feature described by a hwcap, it should check
33 the relevant hwcap flag to verify that the feature is present before
34 attempting to make use of the feature.
36 Features cannot be probed reliably through other means. When a feature
37 is not available, attempting to use it may result in unpredictable
38 behaviour, and is not guaranteed to result in any reliable indication
39 that the feature is unavailable, such as a SIGILL.
42 2. Interpretation of hwcaps
43 ---------------------------
45 The majority of hwcaps are intended to indicate the presence of features
46 which are described by architected ID registers inaccessible to
47 userspace code at EL0. These hwcaps are defined in terms of ID register
48 fields, and should be interpreted with reference to the definition of
49 these fields in the ARM Architecture Reference Manual (ARM ARM).
51 Such hwcaps are described below in the form::
53 Functionality implied by idreg.field == val.
55 Such hwcaps indicate the availability of functionality that the ARM ARM
56 defines as being present when idreg.field has value val, but do not
57 indicate that idreg.field is precisely equal to val, nor do they
58 indicate the absence of functionality implied by other values of
61 Other hwcaps may indicate the presence of features which cannot be
62 described by ID registers alone. These may be described without
63 reference to ID registers, and may refer to other documentation.
66 3. The hwcaps exposed in AT_HWCAP
67 ---------------------------------
70 Functionality implied by ID_AA64PFR0_EL1.FP == 0b0000.
73 Functionality implied by ID_AA64PFR0_EL1.AdvSIMD == 0b0000.
76 The generic timer is configured to generate events at a frequency of
80 Functionality implied by ID_AA64ISAR0_EL1.AES == 0b0001.
83 Functionality implied by ID_AA64ISAR0_EL1.AES == 0b0010.
86 Functionality implied by ID_AA64ISAR0_EL1.SHA1 == 0b0001.
89 Functionality implied by ID_AA64ISAR0_EL1.SHA2 == 0b0001.
92 Functionality implied by ID_AA64ISAR0_EL1.CRC32 == 0b0001.
95 Functionality implied by ID_AA64ISAR0_EL1.Atomic == 0b0010.
98 Functionality implied by ID_AA64PFR0_EL1.FP == 0b0001.
101 Functionality implied by ID_AA64PFR0_EL1.AdvSIMD == 0b0001.
104 EL0 access to certain ID registers is available, to the extent
105 described by Documentation/arm64/cpu-feature-registers.rst.
107 These ID registers may imply the availability of features.
110 Functionality implied by ID_AA64ISAR0_EL1.RDM == 0b0001.
113 Functionality implied by ID_AA64ISAR1_EL1.JSCVT == 0b0001.
116 Functionality implied by ID_AA64ISAR1_EL1.FCMA == 0b0001.
119 Functionality implied by ID_AA64ISAR1_EL1.LRCPC == 0b0001.
122 Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0001.
125 Functionality implied by ID_AA64ISAR0_EL1.SHA3 == 0b0001.
128 Functionality implied by ID_AA64ISAR0_EL1.SM3 == 0b0001.
131 Functionality implied by ID_AA64ISAR0_EL1.SM4 == 0b0001.
134 Functionality implied by ID_AA64ISAR0_EL1.DP == 0b0001.
137 Functionality implied by ID_AA64ISAR0_EL1.SHA2 == 0b0010.
140 Functionality implied by ID_AA64PFR0_EL1.SVE == 0b0001.
143 Functionality implied by ID_AA64ISAR0_EL1.FHM == 0b0001.
146 Functionality implied by ID_AA64PFR0_EL1.DIT == 0b0001.
149 Functionality implied by ID_AA64MMFR2_EL1.AT == 0b0001.
152 Functionality implied by ID_AA64ISAR1_EL1.LRCPC == 0b0010.
155 Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0001.
158 Functionality implied by ID_AA64PFR1_EL1.SSBS == 0b0010.
161 Functionality implied by ID_AA64ISAR1_EL1.SB == 0b0001.
164 Functionality implied by ID_AA64ISAR1_EL1.APA == 0b0001 or
165 ID_AA64ISAR1_EL1.API == 0b0001, as described by
166 Documentation/arm64/pointer-authentication.rst.
169 Functionality implied by ID_AA64ISAR1_EL1.GPA == 0b0001 or
170 ID_AA64ISAR1_EL1.GPI == 0b0001, as described by
171 Documentation/arm64/pointer-authentication.rst.
174 Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0010.
177 Functionality implied by ID_AA64ZFR0_EL1.SVEVer == 0b0001.
180 Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0001.
183 Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0010.
186 Functionality implied by ID_AA64ZFR0_EL1.BitPerm == 0b0001.
189 Functionality implied by ID_AA64ZFR0_EL1.SHA3 == 0b0001.
192 Functionality implied by ID_AA64ZFR0_EL1.SM4 == 0b0001.
195 Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0010.
198 Functionality implied by ID_AA64ISAR1_EL1.FRINTTS == 0b0001.
201 Functionality implied by ID_AA64ZFR0_EL1.I8MM == 0b0001.
204 Functionality implied by ID_AA64ZFR0_EL1.F32MM == 0b0001.
207 Functionality implied by ID_AA64ZFR0_EL1.F64MM == 0b0001.
210 Functionality implied by ID_AA64ZFR0_EL1.BF16 == 0b0001.
213 Functionality implied by ID_AA64ISAR1_EL1.I8MM == 0b0001.
216 Functionality implied by ID_AA64ISAR1_EL1.BF16 == 0b0001.
219 Functionality implied by ID_AA64ISAR1_EL1.DGH == 0b0001.
222 Functionality implied by ID_AA64ISAR0_EL1.RNDR == 0b0001.
225 Functionality implied by ID_AA64PFR0_EL1.BT == 0b0001.
228 Functionality implied by ID_AA64PFR1_EL1.MTE == 0b0010, as described
229 by Documentation/arm64/memory-tagging-extension.rst.
232 Functionality implied by ID_AA64MMFR0_EL1.ECV == 0b0001.
235 Functionality implied by ID_AA64MFR1_EL1.AFP == 0b0001.
238 Functionality implied by ID_AA64ISAR2_EL1.RPRES == 0b0001.
241 Functionality implied by ID_AA64PFR1_EL1.MTE == 0b0011, as described
242 by Documentation/arm64/memory-tagging-extension.rst.
245 Functionality implied by ID_AA64PFR1_EL1.SME == 0b0001, as described
246 by Documentation/arm64/sme.rst.
249 Functionality implied by ID_AA64SMFR0_EL1.I16I64 == 0b1111.
252 Functionality implied by ID_AA64SMFR0_EL1.F64F64 == 0b1.
255 Functionality implied by ID_AA64SMFR0_EL1.I8I32 == 0b1111.
258 Functionality implied by ID_AA64SMFR0_EL1.F16F32 == 0b1.
261 Functionality implied by ID_AA64SMFR0_EL1.B16F32 == 0b1.
264 Functionality implied by ID_AA64SMFR0_EL1.F32F32 == 0b1.
267 Functionality implied by ID_AA64SMFR0_EL1.FA64 == 0b1.
270 Functionality implied by ID_AA64ISAR2_EL1.WFXT == 0b0010.
273 Functionality implied by ID_AA64ISAR1_EL1.BF16 == 0b0010.
276 Functionality implied by ID_AA64ZFR0_EL1.BF16 == 0b0010.
278 4. Unused AT_HWCAP bits
279 -----------------------
281 For interoperation with userspace, the kernel guarantees that bits 62
282 and 63 of AT_HWCAP will always be returned as 0.