Re: [PATCH 2/2] kselftest/arm64: Check that PR_SVE_VL_INHERIT survives a second exec
From: Will Deacon
Date: Fri Nov 27 2026 - 13:43:28 EST
On Sat, Oct 17, 2026 at 12:24:54PM -0600, Abdalla Eldoumani wrote:
> From: Abdalla Eldoumani <abdalla.eldoumani@xxxxxxxxxxx>
>
> The prctl_set_for_child test sets a vector length with
> PR_SVE_VL_INHERIT and checks that a forked and exec()ed child sees it.
> That only covers the first exec(). The kernel keeps the inherit flag
> and the on-exec VL across exec() so that later descendants keep the VL
> too, and nothing checks that part, which the fp TODO list notes as
> testing PR_SVE_VL_INHERIT after a double fork.
>
> Extend the test to also read the VL in a grandchild. The child
> re-executes vec-syscfg in a mode that forks and execs the rdvl helper,
> so the VL is read after two fork() and exec() generations. Both SVE and
> SME are covered since the test runs for each vector type.
>
> With a kernel modified to clear the inherit flag on exec() the existing
> check still passes and the new check fails for both vector types, with
> the grandchild getting the default VL. Drop the item from the TODO list.
>
> Assisted-by: LLM
> Signed-off-by: Abdalla Eldoumani <abdalla.eldoumani@xxxxxxxxxxx>
> ---
> tools/testing/selftests/arm64/fp/TODO | 1 -
> tools/testing/selftests/arm64/fp/vec-syscfg.c | 62 ++++++++++++++++++-
> 2 files changed, 59 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/arm64/fp/TODO b/tools/testing/selftests/arm64/fp/TODO
> index 44004e5..90ee128 100644
> --- a/tools/testing/selftests/arm64/fp/TODO
> +++ b/tools/testing/selftests/arm64/fp/TODO
> @@ -4,4 +4,3 @@
> - Ensure ptraced processes actually see the register state visible through
> the ptrace interface.
> - Big endian.
> -- Test PR_SVE_VL_INHERIT after a double fork.
Since this TODO list was authored by Mark (Brown), it would be good for
him to assess whether or not your patch implements what he had in mind.
I can't see where the initial parent touches the prctl() and the way
you've added the fork() before we even print the selftest header looks
a bit weird to me.
Will