linux-stable/arch/arm64/kernel/vdso
Adhemerval Zanella 712676ea2b arm64: vDSO: Wire up getrandom() vDSO implementation
Hook up the generic vDSO implementation to the aarch64 vDSO data page.
The _vdso_rng_data required data is placed within the _vdso_data vvar
page, by using a offset larger than the vdso_data.

The vDSO function requires a ChaCha20 implementation that does not write
to the stack, and that can do an entire ChaCha20 permutation.  The one
provided uses NEON on the permute operation, with a fallback to the
syscall for chips that do not support AdvSIMD.

This also passes the vdso_test_chacha test along with
vdso_test_getrandom. The vdso_test_getrandom bench-single result on
Neoverse-N1 shows:

   vdso: 25000000 times in 0.783884250 seconds
   libc: 25000000 times in 8.780275399 seconds
syscall: 25000000 times in 8.786581518 seconds

A small fixup to arch/arm64/include/asm/mman.h was required to avoid
pulling kernel code into the vDSO, similar to what's already done in
arch/arm64/include/asm/rwonce.h.

Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2024-09-13 17:28:36 +02:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
gen_vdso_offsets.sh arm64: Support running gen_vdso_offsets.sh with BSD userland. 2021-01-20 12:23:27 +00:00
Makefile arm64: vDSO: Wire up getrandom() vDSO implementation 2024-09-13 17:28:36 +02:00
note.S arm64: vdso: Annotate for BTI 2020-05-07 17:53:20 +01:00
sigreturn.S arm64: vdso: Disable dwarf unwinding through the sigreturn trampoline 2020-06-23 14:47:03 +01:00
vdso.lds.S arm64: vDSO: Wire up getrandom() vDSO implementation 2024-09-13 17:28:36 +02:00
vgetrandom-chacha.S arm64: vDSO: Wire up getrandom() vDSO implementation 2024-09-13 17:28:36 +02:00
vgetrandom.c arm64: vDSO: Wire up getrandom() vDSO implementation 2024-09-13 17:28:36 +02:00
vgettimeofday.c arm64: vdso: Clear common make C=2 warnings 2023-07-20 11:48:26 +01:00