summaryrefslogtreecommitdiffstats
path: root/Documentation/arm64
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-15 13:56:56 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-15 13:56:56 -0500
commitc9b012e5f4a1d01dfa8abc6318211a67ba7d5db2 (patch)
tree97b2f1c654fc4333e9e3111f76a26ec5503ee5b9 /Documentation/arm64
parentb293fca43be544483b6488d33ad4b3ed55881064 (diff)
parent6cfa7cc46b1a7a15d81d5389c99cfca633c12b8e (diff)
Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull arm64 updates from Will Deacon: "The big highlight is support for the Scalable Vector Extension (SVE) which required extensive ABI work to ensure we don't break existing applications by blowing away their signal stack with the rather large new vector context (<= 2 kbit per vector register). There's further work to be done optimising things like exception return, but the ABI is solid now. Much of the line count comes from some new PMU drivers we have, but they're pretty self-contained and I suspect we'll have more of them in future. Plenty of acronym soup here: - initial support for the Scalable Vector Extension (SVE) - improved handling for SError interrupts (required to handle RAS events) - enable GCC support for 128-bit integer types - remove kernel text addresses from backtraces and register dumps - use of WFE to implement long delay()s - ACPI IORT updates from Lorenzo Pieralisi - perf PMU driver for the Statistical Profiling Extension (SPE) - perf PMU driver for Hisilicon's system PMUs - misc cleanups and non-critical fixes" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (97 commits) arm64: Make ARMV8_DEPRECATED depend on SYSCTL arm64: Implement __lshrti3 library function arm64: support __int128 on gcc 5+ arm64/sve: Add documentation arm64/sve: Detect SVE and activate runtime support arm64/sve: KVM: Hide SVE from CPU features exposed to guests arm64/sve: KVM: Treat guest SVE use as undefined instruction execution arm64/sve: KVM: Prevent guests from using SVE arm64/sve: Add sysctl to set the default vector length for new processes arm64/sve: Add prctl controls for userspace vector length management arm64/sve: ptrace and ELF coredump support arm64/sve: Preserve SVE registers around EFI runtime service calls arm64/sve: Preserve SVE registers around kernel-mode NEON use arm64/sve: Probe SVE capabilities and usable vector lengths arm64: cpufeature: Move sys_caps_initialised declarations arm64/sve: Backend logic for setting the vector length arm64/sve: Signal handling support arm64/sve: Support vector length resetting for new processes arm64/sve: Core task context handling arm64/sve: Low-level CPU setup ...
Diffstat (limited to 'Documentation/arm64')
-rw-r--r--Documentation/arm64/cpu-feature-registers.txt18
-rw-r--r--Documentation/arm64/elf_hwcaps.txt160
-rw-r--r--Documentation/arm64/memory.txt10
-rw-r--r--Documentation/arm64/sve.txt508
4 files changed, 689 insertions, 7 deletions
diff --git a/Documentation/arm64/cpu-feature-registers.txt b/Documentation/arm64/cpu-feature-registers.txt
index dad411d635d8..bd9b3faab2c4 100644
--- a/Documentation/arm64/cpu-feature-registers.txt
+++ b/Documentation/arm64/cpu-feature-registers.txt
@@ -110,10 +110,20 @@ infrastructure:
110 x--------------------------------------------------x 110 x--------------------------------------------------x
111 | Name | bits | visible | 111 | Name | bits | visible |
112 |--------------------------------------------------| 112 |--------------------------------------------------|
113 | RES0 | [63-32] | n | 113 | RES0 | [63-48] | n |
114 |--------------------------------------------------|
115 | DP | [47-44] | y |
116 |--------------------------------------------------|
117 | SM4 | [43-40] | y |
118 |--------------------------------------------------|
119 | SM3 | [39-36] | y |
120 |--------------------------------------------------|
121 | SHA3 | [35-32] | y |
114 |--------------------------------------------------| 122 |--------------------------------------------------|
115 | RDM | [31-28] | y | 123 | RDM | [31-28] | y |
116 |--------------------------------------------------| 124 |--------------------------------------------------|
125 | RES0 | [27-24] | n |
126 |--------------------------------------------------|
117 | ATOMICS | [23-20] | y | 127 | ATOMICS | [23-20] | y |
118 |--------------------------------------------------| 128 |--------------------------------------------------|
119 | CRC32 | [19-16] | y | 129 | CRC32 | [19-16] | y |
@@ -132,7 +142,11 @@ infrastructure:
132 x--------------------------------------------------x 142 x--------------------------------------------------x
133 | Name | bits | visible | 143 | Name | bits | visible |
134 |--------------------------------------------------| 144 |--------------------------------------------------|
135 | RES0 | [63-28] | n | 145 | RES0 | [63-36] | n |
146 |--------------------------------------------------|
147 | SVE | [35-32] | y |
148 |--------------------------------------------------|
149 | RES0 | [31-28] | n |
136 |--------------------------------------------------| 150 |--------------------------------------------------|
137 | GIC | [27-24] | n | 151 | GIC | [27-24] | n |
138 |--------------------------------------------------| 152 |--------------------------------------------------|
diff --git a/Documentation/arm64/elf_hwcaps.txt b/Documentation/arm64/elf_hwcaps.txt
new file mode 100644
index 000000000000..89edba12a9e0
--- /dev/null
+++ b/Documentation/arm64/elf_hwcaps.txt
@@ -0,0 +1,160 @@
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
16Userspace software can test for features by acquiring the AT_HWCAP entry
17of the auxilliary vector, and testing whether the relevant flags are
18set, e.g.
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
81 Functionality implied by ID_AA64ISAR1_EL1.AES == 0b0001.
82
83HWCAP_PMULL
84
85 Functionality implied by ID_AA64ISAR1_EL1.AES == 0b0010.
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
138HWCAP_SHA3
139
140 Functionality implied by ID_AA64ISAR0_EL1.SHA3 == 0b0001.
141
142HWCAP_SM3
143
144 Functionality implied by ID_AA64ISAR0_EL1.SM3 == 0b0001.
145
146HWCAP_SM4
147
148 Functionality implied by ID_AA64ISAR0_EL1.SM4 == 0b0001.
149
150HWCAP_ASIMDDP
151
152 Functionality implied by ID_AA64ISAR0_EL1.DP == 0b0001.
153
154HWCAP_SHA512
155
156 Functionality implied by ID_AA64ISAR0_EL1.SHA2 == 0b0002.
157
158HWCAP_SVE
159
160 Functionality implied by ID_AA64PFR0_EL1.SVE == 0b0001.
diff --git a/Documentation/arm64/memory.txt b/Documentation/arm64/memory.txt
index d7273a5f6456..671bc0639262 100644
--- a/Documentation/arm64/memory.txt
+++ b/Documentation/arm64/memory.txt
@@ -86,9 +86,9 @@ Translation table lookup with 64KB pages:
86 +-------------------------------------------------> [63] TTBR0/1 86 +-------------------------------------------------> [63] TTBR0/1
87 87
88 88
89When using KVM, the hypervisor maps kernel pages in EL2, at a fixed 89When using KVM without the Virtualization Host Extensions, the hypervisor
90offset from the kernel VA (top 24bits of the kernel VA set to zero): 90maps kernel pages in EL2 at a fixed offset from the kernel VA. See the
91kern_hyp_va macro for more details.
91 92
92Start End Size Use 93When using KVM with the Virtualization Host Extensions, no additional
93----------------------------------------------------------------------- 94mappings are created, since the host kernel runs directly in EL2.
940000004000000000 0000007fffffffff 256GB kernel objects mapped in HYP
diff --git a/Documentation/arm64/sve.txt b/Documentation/arm64/sve.txt
new file mode 100644
index 000000000000..f128f736b4a5
--- /dev/null
+++ b/Documentation/arm64/sve.txt
@@ -0,0 +1,508 @@
1 Scalable Vector Extension support for AArch64 Linux
2 ===================================================
3
4Author: Dave Martin <Dave.Martin@arm.com>
5Date: 4 August 2017
6
7This document outlines briefly the interface provided to userspace by Linux in
8order to support use of the ARM Scalable Vector Extension (SVE).
9
10This is an outline of the most important features and issues only and not
11intended to be exhaustive.
12
13This document does not aim to describe the SVE architecture or programmer's
14model. To aid understanding, a minimal description of relevant programmer's
15model features for SVE is included in Appendix A.
16
17
181. General
19-----------
20
21* SVE registers Z0..Z31, P0..P15 and FFR and the current vector length VL, are
22 tracked per-thread.
23
24* The presence of SVE is reported to userspace via HWCAP_SVE in the aux vector
25 AT_HWCAP entry. Presence of this flag implies the presence of the SVE
26 instructions and registers, and the Linux-specific system interfaces
27 described in this document. SVE is reported in /proc/cpuinfo as "sve".
28
29* Support for the execution of SVE instructions in userspace can also be
30 detected by reading the CPU ID register ID_AA64PFR0_EL1 using an MRS
31 instruction, and checking that the value of the SVE field is nonzero. [3]
32
33 It does not guarantee the presence of the system interfaces described in the
34 following sections: software that needs to verify that those interfaces are
35 present must check for HWCAP_SVE instead.
36
37* Debuggers should restrict themselves to interacting with the target via the
38 NT_ARM_SVE regset. The recommended way of detecting support for this regset
39 is to connect to a target process first and then attempt a
40 ptrace(PTRACE_GETREGSET, pid, NT_ARM_SVE, &iov).
41
42
432. Vector length terminology
44-----------------------------
45
46The size of an SVE vector (Z) register is referred to as the "vector length".
47
48To avoid confusion about the units used to express vector length, the kernel
49adopts the following conventions:
50
51* Vector length (VL) = size of a Z-register in bytes
52
53* Vector quadwords (VQ) = size of a Z-register in units of 128 bits
54
55(So, VL = 16 * VQ.)
56
57The VQ convention is used where the underlying granularity is important, such
58as in data structure definitions. In most other situations, the VL convention
59is used. This is consistent with the meaning of the "VL" pseudo-register in
60the SVE instruction set architecture.
61
62
633. System call behaviour
64-------------------------
65
66* On syscall, V0..V31 are preserved (as without SVE). Thus, bits [127:0] of
67 Z0..Z31 are preserved. All other bits of Z0..Z31, and all of P0..P15 and FFR
68 become unspecified on return from a syscall.
69
70* The SVE registers are not used to pass arguments to or receive results from
71 any syscall.
72
73* In practice the affected registers/bits will be preserved or will be replaced
74 with zeros on return from a syscall, but userspace should not make
75 assumptions about this. The kernel behaviour may vary on a case-by-case
76 basis.
77
78* All other SVE state of a thread, including the currently configured vector
79 length, the state of the PR_SVE_VL_INHERIT flag, and the deferred vector
80 length (if any), is preserved across all syscalls, subject to the specific
81 exceptions for execve() described in section 6.
82
83 In particular, on return from a fork() or clone(), the parent and new child
84 process or thread share identical SVE configuration, matching that of the
85 parent before the call.
86
87
884. Signal handling
89-------------------
90
91* A new signal frame record sve_context encodes the SVE registers on signal
92 delivery. [1]
93
94* This record is supplementary to fpsimd_context. The FPSR and FPCR registers
95 are only present in fpsimd_context. For convenience, the content of V0..V31
96 is duplicated between sve_context and fpsimd_context.
97
98* The signal frame record for SVE always contains basic metadata, in particular
99 the thread's vector length (in sve_context.vl).
100
101* The SVE registers may or may not be included in the record, depending on
102 whether the registers are live for the thread. The registers are present if
103 and only if:
104 sve_context.head.size >= SVE_SIG_CONTEXT_SIZE(sve_vq_from_vl(sve_context.vl)).
105
106* If the registers are present, the remainder of the record has a vl-dependent
107 size and layout. Macros SVE_SIG_* are defined [1] to facilitate access to
108 the members.
109
110* If the SVE context is too big to fit in sigcontext.__reserved[], then extra
111 space is allocated on the stack, an extra_context record is written in
112 __reserved[] referencing this space. sve_context is then written in the
113 extra space. Refer to [1] for further details about this mechanism.
114
115
1165. Signal return
117-----------------
118
119When returning from a signal handler:
120
121* If there is no sve_context record in the signal frame, or if the record is
122 present but contains no register data as desribed in the previous section,
123 then the SVE registers/bits become non-live and take unspecified values.
124
125* If sve_context is present in the signal frame and contains full register
126 data, the SVE registers become live and are populated with the specified
127 data. However, for backward compatibility reasons, bits [127:0] of Z0..Z31
128 are always restored from the corresponding members of fpsimd_context.vregs[]
129 and not from sve_context. The remaining bits are restored from sve_context.
130
131* Inclusion of fpsimd_context in the signal frame remains mandatory,
132 irrespective of whether sve_context is present or not.
133
134* The vector length cannot be changed via signal return. If sve_context.vl in
135 the signal frame does not match the current vector length, the signal return
136 attempt is treated as illegal, resulting in a forced SIGSEGV.
137
138
1396. prctl extensions
140--------------------
141
142Some new prctl() calls are added to allow programs to manage the SVE vector
143length:
144
145prctl(PR_SVE_SET_VL, unsigned long arg)
146
147 Sets the vector length of the calling thread and related flags, where
148 arg == vl | flags. Other threads of the calling process are unaffected.
149
150 vl is the desired vector length, where sve_vl_valid(vl) must be true.
151
152 flags:
153
154 PR_SVE_SET_VL_INHERIT
155
156 Inherit the current vector length across execve(). Otherwise, the
157 vector length is reset to the system default at execve(). (See
158 Section 9.)
159
160 PR_SVE_SET_VL_ONEXEC
161
162 Defer the requested vector length change until the next execve()
163 performed by this thread.
164
165 The effect is equivalent to implicit exceution of the following
166 call immediately after the next execve() (if any) by the thread:
167
168 prctl(PR_SVE_SET_VL, arg & ~PR_SVE_SET_VL_ONEXEC)
169
170 This allows launching of a new program with a different vector
171 length, while avoiding runtime side effects in the caller.
172
173
174 Without PR_SVE_SET_VL_ONEXEC, the requested change takes effect
175 immediately.
176
177
178 Return value: a nonnegative on success, or a negative value on error:
179 EINVAL: SVE not supported, invalid vector length requested, or
180 invalid flags.
181
182
183 On success:
184
185 * Either the calling thread's vector length or the deferred vector length
186 to be applied at the next execve() by the thread (dependent on whether
187 PR_SVE_SET_VL_ONEXEC is present in arg), is set to the largest value
188 supported by the system that is less than or equal to vl. If vl ==
189 SVE_VL_MAX, the value set will be the largest value supported by the
190 system.
191
192 * Any previously outstanding deferred vector length change in the calling
193 thread is cancelled.
194
195 * The returned value describes the resulting configuration, encoded as for
196 PR_SVE_GET_VL. The vector length reported in this value is the new
197 current vector length for this thread if PR_SVE_SET_VL_ONEXEC was not
198 present in arg; otherwise, the reported vector length is the deferred
199 vector length that will be applied at the next execve() by the calling
200 thread.
201
202 * Changing the vector length causes all of P0..P15, FFR and all bits of
203 Z0..V31 except for Z0 bits [127:0] .. Z31 bits [127:0] to become
204 unspecified. Calling PR_SVE_SET_VL with vl equal to the thread's current
205 vector length, or calling PR_SVE_SET_VL with the PR_SVE_SET_VL_ONEXEC
206 flag, does not constitute a change to the vector length for this purpose.
207
208
209prctl(PR_SVE_GET_VL)
210
211 Gets the vector length of the calling thread.
212
213 The following flag may be OR-ed into the result:
214
215 PR_SVE_SET_VL_INHERIT
216
217 Vector length will be inherited across execve().
218
219 There is no way to determine whether there is an outstanding deferred
220 vector length change (which would only normally be the case between a
221 fork() or vfork() and the corresponding execve() in typical use).
222
223 To extract the vector length from the result, and it with
224 PR_SVE_VL_LEN_MASK.
225
226 Return value: a nonnegative value on success, or a negative value on error:
227 EINVAL: SVE not supported.
228
229
2307. ptrace extensions
231---------------------
232
233* A new regset NT_ARM_SVE is defined for use with PTRACE_GETREGSET and
234 PTRACE_SETREGSET.
235
236 Refer to [2] for definitions.
237
238The regset data starts with struct user_sve_header, containing:
239
240 size
241
242 Size of the complete regset, in bytes.
243 This depends on vl and possibly on other things in the future.
244
245 If a call to PTRACE_GETREGSET requests less data than the value of
246 size, the caller can allocate a larger buffer and retry in order to
247 read the complete regset.
248
249 max_size
250
251 Maximum size in bytes that the regset can grow to for the target
252 thread. The regset won't grow bigger than this even if the target
253 thread changes its vector length etc.
254
255 vl
256
257 Target thread's current vector length, in bytes.
258
259 max_vl
260
261 Maximum possible vector length for the target thread.
262
263 flags
264
265 either
266
267 SVE_PT_REGS_FPSIMD
268
269 SVE registers are not live (GETREGSET) or are to be made
270 non-live (SETREGSET).
271
272 The payload is of type struct user_fpsimd_state, with the same
273 meaning as for NT_PRFPREG, starting at offset
274 SVE_PT_FPSIMD_OFFSET from the start of user_sve_header.
275
276 Extra data might be appended in the future: the size of the
277 payload should be obtained using SVE_PT_FPSIMD_SIZE(vq, flags).
278
279 vq should be obtained using sve_vq_from_vl(vl).
280
281 or
282
283 SVE_PT_REGS_SVE
284
285 SVE registers are live (GETREGSET) or are to be made live
286 (SETREGSET).
287
288 The payload contains the SVE register data, starting at offset
289 SVE_PT_SVE_OFFSET from the start of user_sve_header, and with
290 size SVE_PT_SVE_SIZE(vq, flags);
291
292 ... OR-ed with zero or more of the following flags, which have the same
293 meaning and behaviour as the corresponding PR_SET_VL_* flags:
294
295 SVE_PT_VL_INHERIT
296
297 SVE_PT_VL_ONEXEC (SETREGSET only).
298
299* The effects of changing the vector length and/or flags are equivalent to
300 those documented for PR_SVE_SET_VL.
301
302 The caller must make a further GETREGSET call if it needs to know what VL is
303 actually set by SETREGSET, unless is it known in advance that the requested
304 VL is supported.
305
306* In the SVE_PT_REGS_SVE case, the size and layout of the payload depends on
307 the header fields. The SVE_PT_SVE_*() macros are provided to facilitate
308 access to the members.
309
310* In either case, for SETREGSET it is permissible to omit the payload, in which
311 case only the vector length and flags are changed (along with any
312 consequences of those changes).
313
314* For SETREGSET, if an SVE_PT_REGS_SVE payload is present and the
315 requested VL is not supported, the effect will be the same as if the
316 payload were omitted, except that an EIO error is reported. No
317 attempt is made to translate the payload data to the correct layout
318 for the vector length actually set. The thread's FPSIMD state is
319 preserved, but the remaining bits of the SVE registers become
320 unspecified. It is up to the caller to translate the payload layout
321 for the actual VL and retry.
322
323* The effect of writing a partial, incomplete payload is unspecified.
324
325
3268. ELF coredump extensions
327---------------------------
328
329* A NT_ARM_SVE note will be added to each coredump for each thread of the
330 dumped process. The contents will be equivalent to the data that would have
331 been read if a PTRACE_GETREGSET of NT_ARM_SVE were executed for each thread
332 when the coredump was generated.
333
334
3359. System runtime configuration
336--------------------------------
337
338* To mitigate the ABI impact of expansion of the signal frame, a policy
339 mechanism is provided for administrators, distro maintainers and developers
340 to set the default vector length for userspace processes:
341
342/proc/sys/abi/sve_default_vector_length
343
344 Writing the text representation of an integer to this file sets the system
345 default vector length to the specified value, unless the value is greater
346 than the maximum vector length supported by the system in which case the
347 default vector length is set to that maximum.
348
349 The result can be determined by reopening the file and reading its
350 contents.
351
352 At boot, the default vector length is initially set to 64 or the maximum
353 supported vector length, whichever is smaller. This determines the initial
354 vector length of the init process (PID 1).
355
356 Reading this file returns the current system default vector length.
357
358* At every execve() call, the new vector length of the new process is set to
359 the system default vector length, unless
360
361 * PR_SVE_SET_VL_INHERIT (or equivalently SVE_PT_VL_INHERIT) is set for the
362 calling thread, or
363
364 * a deferred vector length change is pending, established via the
365 PR_SVE_SET_VL_ONEXEC flag (or SVE_PT_VL_ONEXEC).
366
367* Modifying the system default vector length does not affect the vector length
368 of any existing process or thread that does not make an execve() call.
369
370
371Appendix A. SVE programmer's model (informative)
372=================================================
373
374This section provides a minimal description of the additions made by SVE to the
375ARMv8-A programmer's model that are relevant to this document.
376
377Note: This section is for information only and not intended to be complete or
378to replace any architectural specification.
379
380A.1. Registers
381---------------
382
383In A64 state, SVE adds the following:
384
385* 32 8VL-bit vector registers Z0..Z31
386 For each Zn, Zn bits [127:0] alias the ARMv8-A vector register Vn.
387
388 A register write using a Vn register name zeros all bits of the corresponding
389 Zn except for bits [127:0].
390
391* 16 VL-bit predicate registers P0..P15
392
393* 1 VL-bit special-purpose predicate register FFR (the "first-fault register")
394
395* a VL "pseudo-register" that determines the size of each vector register
396
397 The SVE instruction set architecture provides no way to write VL directly.
398 Instead, it can be modified only by EL1 and above, by writing appropriate
399 system registers.
400
401* The value of VL can be configured at runtime by EL1 and above:
402 16 <= VL <= VLmax, where VL must be a multiple of 16.
403
404* The maximum vector length is determined by the hardware:
405 16 <= VLmax <= 256.
406
407 (The SVE architecture specifies 256, but permits future architecture
408 revisions to raise this limit.)
409
410* FPSR and FPCR are retained from ARMv8-A, and interact with SVE floating-point
411 operations in a similar way to the way in which they interact with ARMv8
412 floating-point operations.
413
414 8VL-1 128 0 bit index
415 +---- //// -----------------+
416 Z0 | : V0 |
417 : :
418 Z7 | : V7 |
419 Z8 | : * V8 |
420 : : :
421 Z15 | : *V15 |
422 Z16 | : V16 |
423 : :
424 Z31 | : V31 |
425 +---- //// -----------------+
426 31 0
427 VL-1 0 +-------+
428 +---- //// --+ FPSR | |
429 P0 | | +-------+
430 : | | *FPCR | |
431 P15 | | +-------+
432 +---- //// --+
433 FFR | | +-----+
434 +---- //// --+ VL | |
435 +-----+
436
437(*) callee-save:
438 This only applies to bits [63:0] of Z-/V-registers.
439 FPCR contains callee-save and caller-save bits. See [4] for details.
440
441
442A.2. Procedure call standard
443-----------------------------
444
445The ARMv8-A base procedure call standard is extended as follows with respect to
446the additional SVE register state:
447
448* All SVE register bits that are not shared with FP/SIMD are caller-save.
449
450* Z8 bits [63:0] .. Z15 bits [63:0] are callee-save.
451
452 This follows from the way these bits are mapped to V8..V15, which are caller-
453 save in the base procedure call standard.
454
455
456Appendix B. ARMv8-A FP/SIMD programmer's model
457===============================================
458
459Note: This section is for information only and not intended to be complete or
460to replace any architectural specification.
461
462Refer to [4] for for more information.
463
464ARMv8-A defines the following floating-point / SIMD register state:
465
466* 32 128-bit vector registers V0..V31
467* 2 32-bit status/control registers FPSR, FPCR
468
469 127 0 bit index
470 +---------------+
471 V0 | |
472 : : :
473 V7 | |
474 * V8 | |
475 : : : :
476 *V15 | |
477 V16 | |
478 : : :
479 V31 | |
480 +---------------+
481
482 31 0
483 +-------+
484 FPSR | |
485 +-------+
486 *FPCR | |
487 +-------+
488
489(*) callee-save:
490 This only applies to bits [63:0] of V-registers.
491 FPCR contains a mixture of callee-save and caller-save bits.
492
493
494References
495==========
496
497[1] arch/arm64/include/uapi/asm/sigcontext.h
498 AArch64 Linux signal ABI definitions
499
500[2] arch/arm64/include/uapi/asm/ptrace.h
501 AArch64 Linux ptrace ABI definitions
502
503[3] linux/Documentation/arm64/cpu-feature-registers.txt
504
505[4] ARM IHI0055C
506 http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055c/IHI0055C_beta_aapcs64.pdf
507 http://infocenter.arm.com/help/topic/com.arm.doc.subset.swdev.abi/index.html
508 Procedure Call Standard for the ARM 64-bit Architecture (AArch64)