powerpc/signal: Report minimum signal frame size to userspace via AT_MINSIGSTKSZ
authorNicholas Piggin <npiggin@gmail.com>
Mon, 7 Mar 2022 18:27:34 +0000 (04:27 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 19 May 2022 13:11:26 +0000 (23:11 +1000)
commit2896b2dff49d0377e4372f470dcddbcb26f2be59
tree854ce287fc7cb79a46ba739fb5981a5a67f2a003
parent2f82ec19757f58549467db568c56e7dfff8af283
powerpc/signal: Report minimum signal frame size to userspace via AT_MINSIGSTKSZ

Implement the AT_MINSIGSTKSZ AUXV entry, allowing userspace to
dynamically size stack allocations in a manner forward-compatible with
new processor state saved in the signal frame

For now these statically find the maximum signal frame size rather than
doing any runtime testing of features to minimise the size.

glibc 2.34 will take advantage of this, as will applications that use
use _SC_MINSIGSTKSZ and _SC_SIGSTKSZ.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
References: 94b07c1f8c39 ("arm64: signal: Report signal frame size to userspace via auxv")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220307182734.289289-2-npiggin@gmail.com
arch/powerpc/include/asm/elf.h
arch/powerpc/include/asm/signal.h
arch/powerpc/include/uapi/asm/auxvec.h
arch/powerpc/kernel/signal.c
arch/powerpc/kernel/signal_32.c
arch/powerpc/kernel/signal_64.c