arm64: Expose ARMv8.5 CondM capability to userspace
[linux-block.git] / Documentation / arm64 / elf_hwcaps.txt
CommitLineData
611a7bc7
MR
1ARM64 ELF hwcaps
2================
3
4This document describes the usage and semantics of the arm64 ELF hwcaps.
5
6
71. Introduction
8---------------
9
10Some hardware or software features are only available on some CPU
11implementations, and/or with certain kernel configurations, but have no
12architected discovery mechanism available to userspace code at EL0. The
13kernel exposes the presence of these features to userspace through a set
14of flags called hwcaps, exposed in the auxilliary vector.
15
aaba098f
AM
16Userspace software can test for features by acquiring the AT_HWCAP or
17AT_HWCAP2 entry of the auxiliary vector, and testing whether the relevant
18flags are set, e.g.
611a7bc7
MR
19
20bool floating_point_is_present(void)
21{
22 unsigned long hwcaps = getauxval(AT_HWCAP);
23 if (hwcaps & HWCAP_FP)
24 return true;
25
26 return false;
27}
28
29Where software relies on a feature described by a hwcap, it should check
30the relevant hwcap flag to verify that the feature is present before
31attempting to make use of the feature.
32
33Features cannot be probed reliably through other means. When a feature
34is not available, attempting to use it may result in unpredictable
35behaviour, and is not guaranteed to result in any reliable indication
36that the feature is unavailable, such as a SIGILL.
37
38
392. Interpretation of hwcaps
40---------------------------
41
42The majority of hwcaps are intended to indicate the presence of features
43which are described by architected ID registers inaccessible to
44userspace code at EL0. These hwcaps are defined in terms of ID register
45fields, and should be interpreted with reference to the definition of
46these fields in the ARM Architecture Reference Manual (ARM ARM).
47
48Such hwcaps are described below in the form:
49
50 Functionality implied by idreg.field == val.
51
52Such hwcaps indicate the availability of functionality that the ARM ARM
53defines as being present when idreg.field has value val, but do not
54indicate that idreg.field is precisely equal to val, nor do they
55indicate the absence of functionality implied by other values of
56idreg.field.
57
58Other hwcaps may indicate the presence of features which cannot be
59described by ID registers alone. These may be described without
60reference to ID registers, and may refer to other documentation.
61
62
633. The hwcaps exposed in AT_HWCAP
64---------------------------------
65
66HWCAP_FP
67
68 Functionality implied by ID_AA64PFR0_EL1.FP == 0b0000.
69
70HWCAP_ASIMD
71
72 Functionality implied by ID_AA64PFR0_EL1.AdvSIMD == 0b0000.
73
74HWCAP_EVTSTRM
75
76 The generic timer is configured to generate events at a frequency of
77 approximately 100KHz.
78
79HWCAP_AES
80
4bfbe5ee 81 Functionality implied by ID_AA64ISAR0_EL1.AES == 0b0001.
611a7bc7
MR
82
83HWCAP_PMULL
84
4bfbe5ee 85 Functionality implied by ID_AA64ISAR0_EL1.AES == 0b0010.
611a7bc7
MR
86
87HWCAP_SHA1
88
89 Functionality implied by ID_AA64ISAR0_EL1.SHA1 == 0b0001.
90
91HWCAP_SHA2
92
93 Functionality implied by ID_AA64ISAR0_EL1.SHA2 == 0b0001.
94
95HWCAP_CRC32
96
97 Functionality implied by ID_AA64ISAR0_EL1.CRC32 == 0b0001.
98
99HWCAP_ATOMICS
100
101 Functionality implied by ID_AA64ISAR0_EL1.Atomic == 0b0010.
102
103HWCAP_FPHP
104
105 Functionality implied by ID_AA64PFR0_EL1.FP == 0b0001.
106
107HWCAP_ASIMDHP
108
109 Functionality implied by ID_AA64PFR0_EL1.AdvSIMD == 0b0001.
110
111HWCAP_CPUID
112
113 EL0 access to certain ID registers is available, to the extent
114 described by Documentation/arm64/cpu-feature-registers.txt.
115
116 These ID registers may imply the availability of features.
117
118HWCAP_ASIMDRDM
119
120 Functionality implied by ID_AA64ISAR0_EL1.RDM == 0b0001.
121
122HWCAP_JSCVT
123
124 Functionality implied by ID_AA64ISAR1_EL1.JSCVT == 0b0001.
125
126HWCAP_FCMA
127
128 Functionality implied by ID_AA64ISAR1_EL1.FCMA == 0b0001.
129
130HWCAP_LRCPC
131
132 Functionality implied by ID_AA64ISAR1_EL1.LRCPC == 0b0001.
133
134HWCAP_DCPOP
135
136 Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0001.
137
671db581
AM
138HWCAP2_DCPODP
139
140 Functionality implied by ID_AA64ISAR1_EL1.DPB == 0b0010.
141
611a7bc7
MR
142HWCAP_SHA3
143
144 Functionality implied by ID_AA64ISAR0_EL1.SHA3 == 0b0001.
145
146HWCAP_SM3
147
148 Functionality implied by ID_AA64ISAR0_EL1.SM3 == 0b0001.
149
150HWCAP_SM4
151
152 Functionality implied by ID_AA64ISAR0_EL1.SM4 == 0b0001.
153
154HWCAP_ASIMDDP
155
156 Functionality implied by ID_AA64ISAR0_EL1.DP == 0b0001.
157
158HWCAP_SHA512
159
4bfbe5ee 160 Functionality implied by ID_AA64ISAR0_EL1.SHA2 == 0b0010.
43994d82
DM
161
162HWCAP_SVE
163
164 Functionality implied by ID_AA64PFR0_EL1.SVE == 0b0001.
3b3b6810 165
06a916fe
DM
166HWCAP2_SVE2
167
168 Functionality implied by ID_AA64ZFR0_EL1.SVEVer == 0b0001.
169
170HWCAP2_SVEAES
171
172 Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0001.
173
174HWCAP2_SVEPMULL
175
176 Functionality implied by ID_AA64ZFR0_EL1.AES == 0b0010.
177
178HWCAP2_SVEBITPERM
179
180 Functionality implied by ID_AA64ZFR0_EL1.BitPerm == 0b0001.
181
182HWCAP2_SVESHA3
183
184 Functionality implied by ID_AA64ZFR0_EL1.SHA3 == 0b0001.
185
186HWCAP2_SVESM4
187
188 Functionality implied by ID_AA64ZFR0_EL1.SM4 == 0b0001.
189
3b3b6810
DG
190HWCAP_ASIMDFHM
191
192 Functionality implied by ID_AA64ISAR0_EL1.FHM == 0b0001.
7206dc93
SP
193
194HWCAP_DIT
195
196 Functionality implied by ID_AA64PFR0_EL1.DIT == 0b0001.
197
198HWCAP_USCAT
199
200 Functionality implied by ID_AA64MMFR2_EL1.AT == 0b0001.
201
202HWCAP_ILRCPC
203
4bfbe5ee 204 Functionality implied by ID_AA64ISAR1_EL1.LRCPC == 0b0010.
7206dc93
SP
205
206HWCAP_FLAGM
207
208 Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0001.
ee911761 209
12019374
MB
210HWCAP2_FLAGM2
211
212 Functionality implied by ID_AA64ISAR0_EL1.TS == 0b0010.
213
ee911761
WD
214HWCAP_SSBS
215
216 Functionality implied by ID_AA64PFR1_EL1.SSBS == 0b0010.
fbedc599
MR
217
218HWCAP_PACA
219
220 Functionality implied by ID_AA64ISAR1_EL1.APA == 0b0001 or
221 ID_AA64ISAR1_EL1.API == 0b0001, as described by
222 Documentation/arm64/pointer-authentication.txt.
223
224HWCAP_PACG
225
226 Functionality implied by ID_AA64ISAR1_EL1.GPA == 0b0001 or
227 ID_AA64ISAR1_EL1.GPI == 0b0001, as described by
228 Documentation/arm64/pointer-authentication.txt.
aaba098f
AM
229
230
2314. Unused AT_HWCAP bits
232-----------------------
233
234For interoperation with userspace, the kernel guarantees that bits 62
235and 63 of AT_HWCAP will always be returned as 0.