This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 26/28] arm64/sve: Add documentation
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Dave Martin <Dave dot Martin at arm dot com>, linux-arm-kernel at lists dot infradead dot org
- Cc: nd at arm dot com, Catalin Marinas <catalin dot marinas at arm dot com>, Will Deacon <will dot deacon at arm dot com>, Ard Biesheuvel <ard dot biesheuvel at linaro dot org>, Alex Bennée <alex dot bennee at linaro dot org>, Richard Sandiford <richard dot sandiford at arm dot com>, kvmarm at lists dot cs dot columbia dot edu, libc-alpha at sourceware dot org, linux-arch at vger dot kernel dot org, Mark Rutland <mark dot rutland at arm dot com>
- Date: Thu, 05 Oct 2017 17:39:24 +0100
- Subject: Re: [PATCH v2 26/28] arm64/sve: Add documentation
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- Nodisclaimer: True
- References: <1504198860-12951-1-git-send-email-Dave.Martin@arm.com> <1504198860-12951-27-git-send-email-Dave.Martin@arm.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On 31/08/17 18:00, Dave Martin wrote:
> +prctl(PR_SVE_SET_VL, unsigned long arg)
> +
> + Sets the vector length of the calling thread and related flags, where
> + arg == vl | flags.
> +
> + vl is the desired vector length, where sve_vl_valid(vl) must be true.
> +
> + flags:
> +
> + PR_SVE_SET_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_SVE_SET_VL_ONEXEC
> +
> + Defer the requested vector length change until the next execve().
> + This allows launching of a new program with a different vector
> + length, while avoiding runtime side effects in the caller.
> +
> + This also overrides the effect of PR_SVE_SET_VL_INHERIT for the
> + first execve().
> +
> + Without PR_SVE_SET_VL_ONEXEC, any outstanding deferred vector
> + length change is cancelled.
> +
based on later text it seems this works if exeve is
called in the same thread as prctl was called in.
this is a bit weird from user-space pov so it may
make sense to state it here explicitly.
> + Return value: a nonnegative on success, or a negative value on error:
> + EINVAL: SVE not supported, invalid vector length requested, or
> + invalid flags.
> +
> + On success, the calling thread's vector length is changed to the largest
> + value supported by the system that is less than or equal to vl.
> + If vl == SVE_VL_MAX, the calling thread's vector length is changed to the
> + largest value supported by the system.
> +
> + The returned value describes the resulting configuration, encoded as for
> + PR_SVE_GET_VL.
> +
> + Changing the vector length causes all of P0..P15, FFR and all bits of
> + Z0..V31 except for Z0 bits [127:0] .. Z31 bits [127:0] to become
> + unspecified. Calling PR_SVE_SET_VL with vl equal to the thread's current
> + vector length does not constitute a change to the vector length for this
> + purpose.