linux/arch/s390
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
..
appldata sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
boot s390/boot: Fix KASLR base offset off by __START_KERNEL bytes 2024-08-22 19:24:13 +02:00
configs s390: Remove protvirt and kvm config guards for uv code 2024-07-23 16:02:33 +02:00
crypto s390/crc32: Add missing MODULE_DESCRIPTION() macro 2024-06-28 14:52:30 +02:00
hypfs s390/hypfs_diag: Diag204 busy loop 2024-07-10 19:50:45 +02:00
include s390/vdso: Wire up getrandom() vdso implementation 2024-09-13 20:57:31 +02:00
kernel s390/vdso: Wire up getrandom() vdso implementation 2024-09-13 20:57:31 +02:00
kvm KVM: s390: fix validity interception issue when gisa is switched off 2024-08-06 06:33:18 +00:00
lib s390/alternatives: Rework to allow for callbacks 2024-07-23 16:02:31 +02:00
mm s390: Keep inittext section writable 2024-07-31 16:30:20 +02:00
net s390/bpf: Implement exceptions 2024-07-08 16:39:35 +02:00
pci s390/pci: Allow allocation of more than 1 MSI interrupt 2024-07-23 15:54:58 +02:00
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
tools s390/boot: Fix KASLR base offset off by __START_KERNEL bytes 2024-08-22 19:24:13 +02:00
Kbuild - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
Kconfig s390/vdso: Wire up getrandom() vdso implementation 2024-09-13 20:57:31 +02:00
Kconfig.debug
Makefile s390: use a larger stack for KMSAN 2024-07-03 19:30:24 -07:00