>sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget"/translations/zh_CN/arch/arm64/smemodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/zh_TW/arch/arm64/smemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/it_IT/arch/arm64/smemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ja_JP/arch/arm64/smemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/ko_KR/arch/arm64/smemodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget"/translations/sp_SP/arch/arm64/smemodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h3Scalable Matrix Extension support for AArch64 Linuxh]h3Scalable Matrix Extension support for AArch64 Linux}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhh, &iov). h](h)}(hDebuggers should restrict themselves to interacting with the target via the NT_ARM_SVE, NT_ARM_SSVE, NT_ARM_ZA and NT_ARM_ZT regsets. The recommended way of detecting support for these regsets is to connect to a target process first and then attempt ah]hDebuggers should restrict themselves to interacting with the target via the NT_ARM_SVE, NT_ARM_SSVE, NT_ARM_ZA and NT_ARM_ZT regsets. The recommended way of detecting support for these regsets is to connect to a target process first and then attempt a}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK, &iov). h]h)}(h5ptrace(PTRACE_GETREGSET, pid, NT_ARM_, &iov).h]h5ptrace(PTRACE_GETREGSET, pid, NT_ARM_, &iov).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKAhjubah}(h]h ]h"]h$]h&]uh1j{hhhKAhjubeh}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hWhenever ZA register values are exchanged in memory between userspace and the kernel, the register value is encoded in memory as a series of horizontal vectors from 0 to VL/8-1 stored in the same endianness invariant format as is used for SVE vectors. h]h)}(hWhenever ZA register values are exchanged in memory between userspace and the kernel, the register value is encoded in memory as a series of horizontal vectors from 0 to VL/8-1 stored in the same endianness invariant format as is used for SVE vectors.h]hWhenever ZA register values are exchanged in memory between userspace and the kernel, the register value is encoded in memory as a series of horizontal vectors from 0 to VL/8-1 stored in the same endianness invariant format as is used for SVE vectors.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKChjubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubh)}(hOn thread creation PSTATE.ZA and TPIDR2_EL0 are preserved unless CLONE_VM is specified, in which case PSTATE.ZA is set to 0 and TPIDR2_EL0 is set to 0. h]h)}(hOn thread creation PSTATE.ZA and TPIDR2_EL0 are preserved unless CLONE_VM is specified, in which case PSTATE.ZA is set to 0 and TPIDR2_EL0 is set to 0.h]hOn thread creation PSTATE.ZA and TPIDR2_EL0 are preserved unless CLONE_VM is specified, in which case PSTATE.ZA is set to 0 and TPIDR2_EL0 is set to 0.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKHhjubah}(h]h ]h"]h$]h&]uh1hhhhhhhhNubeh}(h]h ]h"]h$]h&]bullet*uh1hhhhKhhhhubeh}(h]generalah ]h"] 1. generalah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h2. Vector lengthsh]h2. Vector lengths}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj'hhhhhKLubh)}(hSME defines a second vector length similar to the SVE vector length which controls the size of the streaming mode SVE vectors and the ZA matrix array. The ZA matrix is square with each side having as many bytes as a streaming mode SVE vector.h]hSME defines a second vector length similar to the SVE vector length which controls the size of the streaming mode SVE vectors and the ZA matrix array. The ZA matrix is square with each side having as many bytes as a streaming mode SVE vector.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhj'hhubeh}(h]vector-lengthsah ]h"]2. vector lengthsah$]h&]uh1hhhhhhhhKLubh)}(hhh](h)}(h93. Sharing of streaming and non-streaming mode SVE stateh]h93. Sharing of streaming and non-streaming mode SVE state}(hjQhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjNhhhhhKUubh)}(hX8It is implementation defined which if any parts of the SVE state are shared between streaming and non-streaming modes. When switching between modes via software interfaces such as ptrace if no register content is provided as part of switching no state will be assumed to be shared and everything will be zeroed.h]hX8It is implementation defined which if any parts of the SVE state are shared between streaming and non-streaming modes. When switching between modes via software interfaces such as ptrace if no register content is provided as part of switching no state will be assumed to be shared and everything will be zeroed.}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhjNhhubeh}(h]5sharing-of-streaming-and-non-streaming-mode-sve-stateah ]h"]83. sharing of streaming and non-streaming mode sve stateah$]h&]uh1hhhhhhhhKUubh)}(hhh](h)}(h4. System call behaviourh]h4. System call behaviour}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuhhhhhK_ubh)}(hhh](h)}(hzOn syscall PSTATE.ZA is preserved, if PSTATE.ZA==1 then the contents of the ZA matrix and ZTn (if present) are preserved. h]h)}(hyOn syscall PSTATE.ZA is preserved, if PSTATE.ZA==1 then the contents of the ZA matrix and ZTn (if present) are preserved.h]hyOn syscall PSTATE.ZA is preserved, if PSTATE.ZA==1 then the contents of the ZA matrix and ZTn (if present) are preserved.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKahjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hhOn syscall PSTATE.SM will be cleared and the SVE registers will be handled as per the standard SVE ABI. h]h)}(hgOn syscall PSTATE.SM will be cleared and the SVE registers will be handled as per the standard SVE ABI.h]hgOn syscall PSTATE.SM will be cleared and the SVE registers will be handled as per the standard SVE ABI.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hhNone of the SVE registers, ZA or ZTn are used to pass arguments to or receive results from any syscall. h]h)}(hgNone of the SVE registers, ZA or ZTn are used to pass arguments to or receive results from any syscall.h]hgNone of the SVE registers, ZA or ZTn are used to pass arguments to or receive results from any syscall.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hYOn process creation (eg, clone()) the newly created process will have PSTATE.SM cleared. h]h)}(hXOn process creation (eg, clone()) the newly created process will have PSTATE.SM cleared.h]hXOn process creation (eg, clone()) the newly created process will have PSTATE.SM cleared.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubh)}(hXAll other SME state of a thread, including the currently configured vector length, the state of the PR_SME_VL_INHERIT flag, and the deferred vector length (if any), is preserved across all syscalls, subject to the specific exceptions for execve() described in section 6. h]h)}(hXAll other SME state of a thread, including the currently configured vector length, the state of the PR_SME_VL_INHERIT flag, and the deferred vector length (if any), is preserved across all syscalls, subject to the specific exceptions for execve() described in section 6.h]hXAll other SME state of a thread, including the currently configured vector length, the state of the PR_SME_VL_INHERIT flag, and the deferred vector length (if any), is preserved across all syscalls, subject to the specific exceptions for execve() described in section 6.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKmhjubah}(h]h ]h"]h$]h&]uh1hhjhhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhKahjuhhubeh}(h]system-call-behaviourah ]h"]4. system call behaviourah$]h&]uh1hhhhhhhhK_ubh)}(hhh](h)}(h5. Signal handlingh]h5. Signal handling}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKtubh)}(hhh](h)}(hMSignal handlers are invoked with PSTATE.SM=0, PSTATE.ZA=0, and TPIDR2_EL0=0. h]h)}(hLSignal handlers are invoked with PSTATE.SM=0, PSTATE.ZA=0, and TPIDR2_EL0=0.h]hLSignal handlers are invoked with PSTATE.SM=0, PSTATE.ZA=0, and TPIDR2_EL0=0.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKvhj#ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hA new signal frame record TPIDR2_MAGIC is added formatted as a struct tpidr2_context to allow access to TPIDR2_EL0 from signal handlers. h]h)}(hA new signal frame record TPIDR2_MAGIC is added formatted as a struct tpidr2_context to allow access to TPIDR2_EL0 from signal handlers.h]hA new signal frame record TPIDR2_MAGIC is added formatted as a struct tpidr2_context to allow access to TPIDR2_EL0 from signal handlers.}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKxhj;ubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(h^A new signal frame record za_context encodes the ZA register contents on signal delivery. [1] h]h)}(h]A new signal frame record za_context encodes the ZA register contents on signal delivery. [1]h]h]A new signal frame record za_context encodes the ZA register contents on signal delivery. [1]}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK{hjSubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(h|The signal frame record for ZA always contains basic metadata, in particular the thread's vector length (in za_context.vl). h]h)}(h{The signal frame record for ZA always contains basic metadata, in particular the thread's vector length (in za_context.vl).h]h}The signal frame record for ZA always contains basic metadata, in particular the thread’s vector length (in za_context.vl).}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK~hjkubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hThe ZA matrix may or may not be included in the record, depending on the value of PSTATE.ZA. The registers are present if and only if: za_context.head.size >= ZA_SIG_CONTEXT_SIZE(sve_vq_from_vl(za_context.vl)) in which case PSTATE.ZA == 1. h]h)}(hThe ZA matrix may or may not be included in the record, depending on the value of PSTATE.ZA. The registers are present if and only if: za_context.head.size >= ZA_SIG_CONTEXT_SIZE(sve_vq_from_vl(za_context.vl)) in which case PSTATE.ZA == 1.h]hThe ZA matrix may or may not be included in the record, depending on the value of PSTATE.ZA. The registers are present if and only if: za_context.head.size >= ZA_SIG_CONTEXT_SIZE(sve_vq_from_vl(za_context.vl)) in which case PSTATE.ZA == 1.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hIf matrix data is present, the remainder of the record has a vl-dependent size and layout. Macros ZA_SIG_* are defined [1] to facilitate access to them. h]h)}(hIf matrix data is present, the remainder of the record has a vl-dependent size and layout. Macros ZA_SIG_* are defined [1] to facilitate access to them.h]hIf matrix data is present, the remainder of the record has a vl-dependent size and layout. Macros ZA_SIG_* are defined [1] to facilitate access to them.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hfThe matrix is stored as a series of horizontal vectors in the same format as is used for SVE vectors. h]h)}(heThe matrix is stored as a series of horizontal vectors in the same format as is used for SVE vectors.h]heThe matrix is stored as a series of horizontal vectors in the same format as is used for SVE vectors.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hXIf the ZA context is too big to fit in sigcontext.__reserved[], then extra space is allocated on the stack, an extra_context record is written in __reserved[] referencing this space. za_context is then written in the extra space. Refer to [1] for further details about this mechanism. h]h)}(hXIf the ZA context is too big to fit in sigcontext.__reserved[], then extra space is allocated on the stack, an extra_context record is written in __reserved[] referencing this space. za_context is then written in the extra space. Refer to [1] for further details about this mechanism.h]hXIf the ZA context is too big to fit in sigcontext.__reserved[], then extra space is allocated on the stack, an extra_context record is written in __reserved[] referencing this space. za_context is then written in the extra space. Refer to [1] for further details about this mechanism.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(h[If ZTn is supported and PSTATE.ZA==1 then a signal frame record for ZTn will be generated. h]h)}(hZIf ZTn is supported and PSTATE.ZA==1 then a signal frame record for ZTn will be generated.h]hZIf ZTn is supported and PSTATE.ZA==1 then a signal frame record for ZTn will be generated.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubh)}(hX The signal record for ZTn has magic ZT_MAGIC (0x5a544e01) and consists of a standard signal frame header followed by a struct zt_context specifying the number of ZTn registers supported by the system, then zt_context.nregs blocks of 64 bytes of data per register. h]h)}(hXThe signal record for ZTn has magic ZT_MAGIC (0x5a544e01) and consists of a standard signal frame header followed by a struct zt_context specifying the number of ZTn registers supported by the system, then zt_context.nregs blocks of 64 bytes of data per register.h]hXThe signal record for ZTn has magic ZT_MAGIC (0x5a544e01) and consists of a standard signal frame header followed by a struct zt_context specifying the number of ZTn registers supported by the system, then zt_context.nregs blocks of 64 bytes of data per register.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhKvhjhhubeh}(h]signal-handlingah ]h"]5. signal handlingah$]h&]uh1hhhhhhhhKtubh)}(hhh](h)}(h5. Signal returnh]h5. Signal return}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj!hhhhhKubh)}(h%When returning from a signal handler:h]h%When returning from a signal handler:}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj!hhubh)}(hhh](h)}(hIf there is no za_context record in the signal frame, or if the record is present but contains no register data as described in the previous section, then ZA is disabled. h]h)}(hIf there is no za_context record in the signal frame, or if the record is present but contains no register data as described in the previous section, then ZA is disabled.h]hIf there is no za_context record in the signal frame, or if the record is present but contains no register data as described in the previous section, then ZA is disabled.}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjCubah}(h]h ]h"]h$]h&]uh1hhj@hhhhhNubh)}(hIf za_context is present in the signal frame and contains matrix data then PSTATE.ZA is set to 1 and ZA is populated with the specified data. h]h)}(hIf za_context is present in the signal frame and contains matrix data then PSTATE.ZA is set to 1 and ZA is populated with the specified data.h]hIf za_context is present in the signal frame and contains matrix data then PSTATE.ZA is set to 1 and ZA is populated with the specified data.}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj[ubah}(h]h ]h"]h$]h&]uh1hhj@hhhhhNubh)}(hThe vector length cannot be changed via signal return. If za_context.vl in the signal frame does not match the current vector length, the signal return attempt is treated as illegal, resulting in a forced SIGSEGV. h]h)}(hThe vector length cannot be changed via signal return. If za_context.vl in the signal frame does not match the current vector length, the signal return attempt is treated as illegal, resulting in a forced SIGSEGV.h]hThe vector length cannot be changed via signal return. If za_context.vl in the signal frame does not match the current vector length, the signal return attempt is treated as illegal, resulting in a forced SIGSEGV.}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjsubah}(h]h ]h"]h$]h&]uh1hhj@hhhhhNubh)}(hIf ZTn is not supported or PSTATE.ZA==0 then it is illegal to have a signal frame record for ZTn, resulting in a forced SIGSEGV. h]h)}(hIf ZTn is not supported or PSTATE.ZA==0 then it is illegal to have a signal frame record for ZTn, resulting in a forced SIGSEGV.h]hIf ZTn is not supported or PSTATE.ZA==0 then it is illegal to have a signal frame record for ZTn, resulting in a forced SIGSEGV.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhj@hhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhKhj!hhubeh}(h] signal-returnah ]h"]5. signal returnah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h6. prctl extensionsh]h6. prctl extensions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hSSome new prctl() calls are added to allow programs to manage the SME vector length:h]hSSome new prctl() calls are added to allow programs to manage the SME vector length:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h'prctl(PR_SME_SET_VL, unsigned long arg)h]h'prctl(PR_SME_SET_VL, unsigned long arg)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj|)}(hX Sets the vector length of the calling thread and related flags, where arg == vl | flags. Other threads of the calling process are unaffected. vl is the desired vector length, where sve_vl_valid(vl) must be true. flags: PR_SME_VL_INHERIT Inherit the current vector length across execve(). Otherwise, the vector length is reset to the system default at execve(). (See Section 9.) PR_SME_SET_VL_ONEXEC Defer the requested vector length change until the next execve() performed by this thread. The effect is equivalent to implicit execution of the following call immediately after the next execve() (if any) by the thread: prctl(PR_SME_SET_VL, arg & ~PR_SME_SET_VL_ONEXEC) This allows launching of a new program with a different vector length, while avoiding runtime side effects in the caller. Without PR_SME_SET_VL_ONEXEC, the requested change takes effect immediately. Return value: a nonnegative on success, or a negative value on error: EINVAL: SME not supported, invalid vector length requested, or invalid flags. On success: * Either the calling thread's vector length or the deferred vector length to be applied at the next execve() by the thread (dependent on whether PR_SME_SET_VL_ONEXEC is present in arg), is set to the largest value supported by the system that is less than or equal to vl. If vl == SVE_VL_MAX, the value set will be the largest value supported by the system. * Any previously outstanding deferred vector length change in the calling thread is cancelled. * The returned value describes the resulting configuration, encoded as for PR_SME_GET_VL. The vector length reported in this value is the new current vector length for this thread if PR_SME_SET_VL_ONEXEC was not present in arg; otherwise, the reported vector length is the deferred vector length that will be applied at the next execve() by the calling thread. * Changing the vector length causes all of ZA, ZTn, P0..P15, FFR and all bits of Z0..Z31 except for Z0 bits [127:0] .. Z31 bits [127:0] to become unspecified, including both streaming and non-streaming SVE state. Calling PR_SME_SET_VL with vl equal to the thread's current vector length, or calling PR_SME_SET_VL with the PR_SME_SET_VL_ONEXEC flag, does not constitute a change to the vector length for this purpose. * Changing the vector length causes PSTATE.ZA to be cleared. Calling PR_SME_SET_VL with vl equal to the thread's current vector length, or calling PR_SME_SET_VL with the PR_SME_SET_VL_ONEXEC flag, does not constitute a change to the vector length for this purpose. h](h)}(hSets the vector length of the calling thread and related flags, where arg == vl | flags. Other threads of the calling process are unaffected.h]hSets the vector length of the calling thread and related flags, where arg == vl | flags. Other threads of the calling process are unaffected.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hEvl is the desired vector length, where sve_vl_valid(vl) must be true.h]hEvl is the desired vector length, where sve_vl_valid(vl) must be true.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hflags:h]hflags:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj|)}(hXPR_SME_VL_INHERIT Inherit the current vector length across execve(). Otherwise, the vector length is reset to the system default at execve(). (See Section 9.) PR_SME_SET_VL_ONEXEC Defer the requested vector length change until the next execve() performed by this thread. The effect is equivalent to implicit execution of the following call immediately after the next execve() (if any) by the thread: prctl(PR_SME_SET_VL, arg & ~PR_SME_SET_VL_ONEXEC) This allows launching of a new program with a different vector length, while avoiding runtime side effects in the caller. Without PR_SME_SET_VL_ONEXEC, the requested change takes effect immediately. h](h)}(hPR_SME_VL_INHERITh]hPR_SME_VL_INHERIT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubj|)}(hInherit the current vector length across execve(). Otherwise, the vector length is reset to the system default at execve(). (See Section 9.) h]h)}(hInherit the current vector length across execve(). Otherwise, the vector length is reset to the system default at execve(). (See Section 9.)h]hInherit the current vector length across execve(). Otherwise, the vector length is reset to the system default at execve(). (See Section 9.)}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1j{hhhKhj ubh)}(hPR_SME_SET_VL_ONEXECh]hPR_SME_SET_VL_ONEXEC}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubj|)}(hXDefer the requested vector length change until the next execve() performed by this thread. The effect is equivalent to implicit execution of the following call immediately after the next execve() (if any) by the thread: prctl(PR_SME_SET_VL, arg & ~PR_SME_SET_VL_ONEXEC) This allows launching of a new program with a different vector length, while avoiding runtime side effects in the caller. Without PR_SME_SET_VL_ONEXEC, the requested change takes effect immediately. h](h)}(hZDefer the requested vector length change until the next execve() performed by this thread.h]hZDefer the requested vector length change until the next execve() performed by this thread.}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjDubh)}(hThe effect is equivalent to implicit execution of the following call immediately after the next execve() (if any) by the thread:h]hThe effect is equivalent to implicit execution of the following call immediately after the next execve() (if any) by the thread:}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjDubj|)}(h2prctl(PR_SME_SET_VL, arg & ~PR_SME_SET_VL_ONEXEC) h]h)}(h1prctl(PR_SME_SET_VL, arg & ~PR_SME_SET_VL_ONEXEC)h]h1prctl(PR_SME_SET_VL, arg & ~PR_SME_SET_VL_ONEXEC)}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjdubah}(h]h ]h"]h$]h&]uh1j{hhhKhjDubh)}(hyThis allows launching of a new program with a different vector length, while avoiding runtime side effects in the caller.h]hyThis allows launching of a new program with a different vector length, while avoiding runtime side effects in the caller.}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjDubh)}(hLWithout PR_SME_SET_VL_ONEXEC, the requested change takes effect immediately.h]hLWithout PR_SME_SET_VL_ONEXEC, the requested change takes effect immediately.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjDubeh}(h]h ]h"]h$]h&]uh1j{hhhKhj ubeh}(h]h ]h"]h$]h&]uh1j{hhhKhjubhdefinition_list)}(hhh]hdefinition_list_item)}(hReturn value: a nonnegative on success, or a negative value on error: EINVAL: SME not supported, invalid vector length requested, or invalid flags. h](hterm)}(hEReturn value: a nonnegative on success, or a negative value on error:h]hEReturn value: a nonnegative on success, or a negative value on error:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubh definition)}(hhh]j)}(hhh]j)}(hOEINVAL: SME not supported, invalid vector length requested, or invalid flags. h](j)}(h>EINVAL: SME not supported, invalid vector length requested, orh]h>EINVAL: SME not supported, invalid vector length requested, or}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh]h)}(hinvalid flags.h]hinvalid flags.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubh)}(h On success:h]h On success:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(hhh](h)}(hXeEither the calling thread's vector length or the deferred vector length to be applied at the next execve() by the thread (dependent on whether PR_SME_SET_VL_ONEXEC is present in arg), is set to the largest value supported by the system that is less than or equal to vl. If vl == SVE_VL_MAX, the value set will be the largest value supported by the system. h]h)}(hXdEither the calling thread's vector length or the deferred vector length to be applied at the next execve() by the thread (dependent on whether PR_SME_SET_VL_ONEXEC is present in arg), is set to the largest value supported by the system that is less than or equal to vl. If vl == SVE_VL_MAX, the value set will be the largest value supported by the system.h]hXfEither the calling thread’s vector length or the deferred vector length to be applied at the next execve() by the thread (dependent on whether PR_SME_SET_VL_ONEXEC is present in arg), is set to the largest value supported by the system that is less than or equal to vl. If vl == SVE_VL_MAX, the value set will be the largest value supported by the system.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubh)}(h]Any previously outstanding deferred vector length change in the calling thread is cancelled. h]h)}(h\Any previously outstanding deferred vector length change in the calling thread is cancelled.h]h\Any previously outstanding deferred vector length change in the calling thread is cancelled.}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj7ubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hXhThe returned value describes the resulting configuration, encoded as for PR_SME_GET_VL. The vector length reported in this value is the new current vector length for this thread if PR_SME_SET_VL_ONEXEC was not present in arg; otherwise, the reported vector length is the deferred vector length that will be applied at the next execve() by the calling thread. h]h)}(hXgThe returned value describes the resulting configuration, encoded as for PR_SME_GET_VL. The vector length reported in this value is the new current vector length for this thread if PR_SME_SET_VL_ONEXEC was not present in arg; otherwise, the reported vector length is the deferred vector length that will be applied at the next execve() by the calling thread.h]hXgThe returned value describes the resulting configuration, encoded as for PR_SME_GET_VL. The vector length reported in this value is the new current vector length for this thread if PR_SME_SET_VL_ONEXEC was not present in arg; otherwise, the reported vector length is the deferred vector length that will be applied at the next execve() by the calling thread.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjOubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hXChanging the vector length causes all of ZA, ZTn, P0..P15, FFR and all bits of Z0..Z31 except for Z0 bits [127:0] .. Z31 bits [127:0] to become unspecified, including both streaming and non-streaming SVE state. Calling PR_SME_SET_VL with vl equal to the thread's current vector length, or calling PR_SME_SET_VL with the PR_SME_SET_VL_ONEXEC flag, does not constitute a change to the vector length for this purpose. h]h)}(hXChanging the vector length causes all of ZA, ZTn, P0..P15, FFR and all bits of Z0..Z31 except for Z0 bits [127:0] .. Z31 bits [127:0] to become unspecified, including both streaming and non-streaming SVE state. Calling PR_SME_SET_VL with vl equal to the thread's current vector length, or calling PR_SME_SET_VL with the PR_SME_SET_VL_ONEXEC flag, does not constitute a change to the vector length for this purpose.h]hXChanging the vector length causes all of ZA, ZTn, P0..P15, FFR and all bits of Z0..Z31 except for Z0 bits [127:0] .. Z31 bits [127:0] to become unspecified, including both streaming and non-streaming SVE state. Calling PR_SME_SET_VL with vl equal to the thread’s current vector length, or calling PR_SME_SET_VL with the PR_SME_SET_VL_ONEXEC flag, does not constitute a change to the vector length for this purpose.}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjgubah}(h]h ]h"]h$]h&]uh1hhjubh)}(hXChanging the vector length causes PSTATE.ZA to be cleared. Calling PR_SME_SET_VL with vl equal to the thread's current vector length, or calling PR_SME_SET_VL with the PR_SME_SET_VL_ONEXEC flag, does not constitute a change to the vector length for this purpose. h]h)}(hXChanging the vector length causes PSTATE.ZA to be cleared. Calling PR_SME_SET_VL with vl equal to the thread's current vector length, or calling PR_SME_SET_VL with the PR_SME_SET_VL_ONEXEC flag, does not constitute a change to the vector length for this purpose.h]hXChanging the vector length causes PSTATE.ZA to be cleared. Calling PR_SME_SET_VL with vl equal to the thread’s current vector length, or calling PR_SME_SET_VL with the PR_SME_SET_VL_ONEXEC flag, does not constitute a change to the vector length for this purpose.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]jjuh1hhhhKhjubeh}(h]h ]h"]h$]h&]uh1j{hhhKhjhhubh)}(hprctl(PR_SME_GET_VL)h]hprctl(PR_SME_GET_VL)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj|)}(hXDGets the vector length of the calling thread. The following flag may be OR-ed into the result: PR_SME_VL_INHERIT Vector length will be inherited across execve(). There is no way to determine whether there is an outstanding deferred vector length change (which would only normally be the case between a fork() or vfork() and the corresponding execve() in typical use). To extract the vector length from the result, bitwise and it with PR_SME_VL_LEN_MASK. Return value: a nonnegative value on success, or a negative value on error: EINVAL: SME not supported. h](h)}(h-Gets the vector length of the calling thread.h]h-Gets the vector length of the calling thread.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubh)}(h0The following flag may be OR-ed into the result:h]h0The following flag may be OR-ed into the result:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj|)}(hHPR_SME_VL_INHERIT Vector length will be inherited across execve(). h](h)}(hPR_SME_VL_INHERITh]hPR_SME_VL_INHERIT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj|)}(h1Vector length will be inherited across execve(). h]h)}(h0Vector length will be inherited across execve().h]h0Vector length will be inherited across execve().}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1j{hhhMhjubeh}(h]h ]h"]h$]h&]uh1j{hhhMhjubh)}(hThere is no way to determine whether there is an outstanding deferred vector length change (which would only normally be the case between a fork() or vfork() and the corresponding execve() in typical use).h]hThere is no way to determine whether there is an outstanding deferred vector length change (which would only normally be the case between a fork() or vfork() and the corresponding execve() in typical use).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hUTo extract the vector length from the result, bitwise and it with PR_SME_VL_LEN_MASK.h]hUTo extract the vector length from the result, bitwise and it with PR_SME_VL_LEN_MASK.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj)}(hhh]j)}(hhReturn value: a nonnegative value on success, or a negative value on error: EINVAL: SME not supported. h](j)}(hKReturn value: a nonnegative value on success, or a negative value on error:h]hKReturn value: a nonnegative value on success, or a negative value on error:}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhM hj ubj)}(hhh]h)}(hEINVAL: SME not supported.h]hEINVAL: SME not supported.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hj2ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhhhM hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1j{hhhKhjhhubeh}(h]prctl-extensionsah ]h"]6. prctl extensionsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h7. ptrace extensionsh]h7. ptrace extensions}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjchhhhhMubh)}(hhh](h)}(hA new regset NT_ARM_SSVE is defined for access to streaming mode SVE state via PTRACE_GETREGSET and PTRACE_SETREGSET, this is documented in sve.rst. h]h)}(hA new regset NT_ARM_SSVE is defined for access to streaming mode SVE state via PTRACE_GETREGSET and PTRACE_SETREGSET, this is documented in sve.rst.h]hA new regset NT_ARM_SSVE is defined for access to streaming mode SVE state via PTRACE_GETREGSET and PTRACE_SETREGSET, this is documented in sve.rst.}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjwubah}(h]h ]h"]h$]h&]uh1hhjthhhhhNubh)}(hA new regset NT_ARM_ZA is defined for ZA state for access to ZA state via PTRACE_GETREGSET and PTRACE_SETREGSET. Refer to [2] for definitions. h](h)}(hpA new regset NT_ARM_ZA is defined for ZA state for access to ZA state via PTRACE_GETREGSET and PTRACE_SETREGSET.h]hpA new regset NT_ARM_ZA is defined for ZA state for access to ZA state via PTRACE_GETREGSET and PTRACE_SETREGSET.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hRefer to [2] for definitions.h]hRefer to [2] for definitions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubeh}(h]h ]h"]h$]h&]uh1hhjthhhhhNubeh}(h]h ]h"]h$]h&]jjuh1hhhhMhjchhubh)}(h>The regset data starts with struct user_za_header, containing:h]h>The regset data starts with struct user_za_header, containing:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjchhubj|)}(hXBsize Size of the complete regset, in bytes. This depends on vl and possibly on other things in the future. If a call to PTRACE_GETREGSET requests less data than the value of size, the caller can allocate a larger buffer and retry in order to read the complete regset. max_size Maximum size in bytes that the regset can grow to for the target thread. The regset won't grow bigger than this even if the target thread changes its vector length etc. vl Target thread's current streaming vector length, in bytes. max_vl Maximum possible streaming vector length for the target thread. flags Zero or more of the following flags, which have the same meaning and behaviour as the corresponding PR_SET_VL_* flags: SME_PT_VL_INHERIT SME_PT_VL_ONEXEC (SETREGSET only). h](h)}(hsizeh]hsize}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubj|)}(hXSize of the complete regset, in bytes. This depends on vl and possibly on other things in the future. If a call to PTRACE_GETREGSET requests less data than the value of size, the caller can allocate a larger buffer and retry in order to read the complete regset. h](h)}(heSize of the complete regset, in bytes. This depends on vl and possibly on other things in the future.h]heSize of the complete regset, in bytes. This depends on vl and possibly on other things in the future.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubh)}(hIf a call to PTRACE_GETREGSET requests less data than the value of size, the caller can allocate a larger buffer and retry in order to read the complete regset.h]hIf a call to PTRACE_GETREGSET requests less data than the value of size, the caller can allocate a larger buffer and retry in order to read the complete regset.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM"hjubeh}(h]h ]h"]h$]h&]uh1j{hhhMhjubh)}(hmax_sizeh]hmax_size}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM&hjubj|)}(hMaximum size in bytes that the regset can grow to for the target thread. The regset won't grow bigger than this even if the target thread changes its vector length etc. h]h)}(hMaximum size in bytes that the regset can grow to for the target thread. The regset won't grow bigger than this even if the target thread changes its vector length etc.h]hMaximum size in bytes that the regset can grow to for the target thread. The regset won’t grow bigger than this even if the target thread changes its vector length etc.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM(hjubah}(h]h ]h"]h$]h&]uh1j{hhhM(hjubh)}(hvlh]hvl}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM,hjubj|)}(h;Target thread's current streaming vector length, in bytes. h]h)}(h:Target thread's current streaming vector length, in bytes.h]h