linux/tools/arch
Heiko Carstens b920aa77be s390/vdso: Wire up getrandom() vdso implementation
Provide the s390 specific vdso getrandom() architecture backend.

_vdso_rng_data required data is placed within the _vdso_data vvar page,
by using a hardcoded offset larger than vdso_data.

As required the chacha20 implementation does not write to the stack.

The implementation follows more or less the arm64 implementations and
makes use of vector instructions. It has a fallback to the getrandom()
system call for machines where the vector facility is not installed.

The check if the vector facility is installed, as well as an
optimization for machines with the vector-enhancements facility 2, is
implemented with alternatives, avoiding runtime checks.

Note that __kernel_getrandom() is implemented without the vdso user
wrapper which would setup a stack frame for odd cases (aka very old
glibc variants) where the caller has not done that. All callers of
__kernel_getrandom() are required to setup a stack frame, like the C ABI
requires it.

The vdso testcases vdso_test_getrandom and vdso_test_chacha pass.

Benchmark on a z16:

    $ ./vdso_test_getrandom bench-single
       vdso: 25000000 times in 0.493703559 seconds
    syscall: 25000000 times in 6.584025337 seconds

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2024-09-13 20:57:31 +02:00
..
alpha/include
arc/include/uapi/asm
arm/include tools headers kvm: Sync kvm headers with the kernel sources 2019-12-02 12:54:13 -03:00
arm64 arm64: vDSO: Wire up getrandom() vDSO implementation 2024-09-13 17:28:36 +02:00
csky/include/uapi/asm
hexagon/include/uapi/asm tools arch: Remove uapi bitsperlong.h of hexagon and microblaze 2023-06-22 17:04:37 +02:00
loongarch LoongArch: vDSO: Wire up getrandom() vDSO implementation 2024-09-13 17:28:35 +02:00
microblaze/include/uapi/asm tools arch: Remove uapi bitsperlong.h of hexagon and microblaze 2023-06-22 17:04:37 +02:00
mips/include perf tools: Copy uapi/asm/perf_regs.h from the kernel for MIPS 2021-06-01 10:07:46 -03:00
parisc/include/uapi/asm parisc: Drop the HP-UX ENOSYM and EREMOTERELEASE error codes 2023-11-25 09:43:18 +01:00
powerpc powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO32 2024-09-13 17:28:36 +02:00
riscv/include tools: riscv: Add header file vdso/processor.h 2024-02-26 10:14:04 +05:30
s390 s390/vdso: Wire up getrandom() vdso implementation 2024-09-13 20:57:31 +02:00
sh/include sh: remove sh5 support 2020-06-01 14:48:52 -04:00
sparc/include tools headers UAPI: Update tools's copy of mman.h headers 2019-07-29 09:02:58 -03:00
x86 selftests: vDSO: don't hard-code location of vDSO sources 2024-08-30 15:44:33 +02:00
xtensa/include