4 This document describes the usage and semantics of the arm64 ELF hwcaps.
10 Some hardware or software features are only available on some CPU
11 implementations, and/or with certain kernel configurations, but have no
12 architected discovery mechanism available to userspace code at EL0. The
13 kernel exposes the presence of these features to userspace through a set
14 of flags called hwcaps, exposed in the auxilliary vector.
16 Userspace software can test for features by acquiring the AT_HWCAP entry
17 of the auxilliary vector, and testing whether the relevant flags are
20 bool floating_point_is_present(void)
22 unsigned long hwcaps = getauxval(AT_HWCAP);
23 if (hwcaps & HWCAP_FP)
29 Where software relies on a feature described by a hwcap, it should check
30 the relevant hwcap flag to verify that the feature is present before
31 attempting to make use of the feature.
33 Features cannot be probed reliably through other means. When a feature
34 is not available, attempting to use it may result in unpredictable
35 behaviour, and is not guaranteed to result in any reliable indication
36 that the feature is unavailable, such as a SIGILL.
39 2. Interpretation of hwcaps
40 ---------------------------
42 The majority of hwcaps are intended to indicate the presence of features
43 which are described by architected ID registers inaccessible to
44 userspace code at EL0. These hwcaps are defined in terms of ID register
45 fields, and should be interpreted with reference to the definition of
46 these fields in the ARM Architecture Reference Manual (ARM ARM).
48 Such hwcaps are described below in the form:
50 Functionality implied by idreg.field == val.
52 Such hwcaps indicate the availability of functionality that the ARM ARM
53 defines as being present when idreg.field has value val, but do not
54 indicate that idreg.field is precisely equal to val, nor do they
55 indicate the absence of functionality implied by other values of
58 Other hwcaps may indicate the presence of features which cannot be
59 described by ID registers alone. These may be described without
60 reference to ID registers, and may refer to other documentation.
63 3. The hwcaps exposed in AT_HWCAP
64 ---------------------------------
68 Functionality implied by ID_AA64PFR0_EL1.FP == 0b0000.
72 Functionality implied by ID_AA64PFR0_EL1.AdvSIMD == 0b0000.
76 The generic timer is configured to generate events at a frequency of
81 Functionality implied by ID_AA64ISAR1_EL1.AES == 0b0001.
85 Functionality implied by ID_AA64ISAR1_EL1.AES == 0b0010.
89 Functionality implied by ID_AA64ISAR0_EL1.SHA1 == 0b0001.
93 Functionality implied by ID_AA64ISAR0_EL1.SHA2 == 0b0001.
97 Functionality implied by ID_AA64ISAR0_EL1.CRC32 == 0b0001.
101 Functionality implied by ID_AA64ISAR0_EL1.Atomic == 0b0010.
105 Functionality implied by ID_AA64PFR0_EL1.FP == 0b0001.
109 Functionality implied by ID_AA64PFR0_EL1.AdvSIMD == 0b0001.
113 EL0 access to certain ID registers is available, to the extent
114 described by Documentation/arm64/cpu-feature-registers.txt.
116 These ID registers may imply the availability of features.
120 Functionality implied by ID_AA64ISAR0_EL1.RDM == 0b0001.
124 Functionality implied by ID_AA64ISAR1_EL1.JSCVT == 0b0001.
128 Functionality implied by ID_AA64ISAR1_EL1.FCMA == 0b0001.
132 Functionality implied by ID_AA64ISAR1_EL1.LRCPC == 0b0001.
136 Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0001.
140 Functionality implied by ID_AA64ISAR0_EL1.SHA3 == 0b0001.
144 Functionality implied by ID_AA64ISAR0_EL1.SM3 == 0b0001.
148 Functionality implied by ID_AA64ISAR0_EL1.SM4 == 0b0001.
152 Functionality implied by ID_AA64ISAR0_EL1.DP == 0b0001.
156 Functionality implied by ID_AA64ISAR0_EL1.SHA2 == 0b0002.
160 Functionality implied by ID_AA64PFR0_EL1.SVE == 0b0001.
164 Functionality implied by ID_AA64ISAR0_EL1.FHM == 0b0001.
168 Functionality implied by ID_AA64PFR0_EL1.DIT == 0b0001.
172 Functionality implied by ID_AA64MMFR2_EL1.AT == 0b0001.
176 Functionality implied by ID_AA64ISR1_EL1.LRCPC == 0b0002.
180 Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0001.
184 Functionality implied by ID_AA64PFR1_EL1.SSBS == 0b0010.