]> www.infradead.org Git - users/willy/xarray.git/commit
selftests: vDSO: check cpu caps before running chacha test
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 14 Sep 2024 23:07:27 +0000 (01:07 +0200)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 16 Sep 2024 11:22:04 +0000 (13:22 +0200)
commit210860e7f7337e47e77577fa5bb168767e2d8a1e
tree79862126621141b90a8210239d96679b17b608b5
parentb920aa77be6d57d407b6b6be5d8b4ccc17749cce
selftests: vDSO: check cpu caps before running chacha test

Some archs -- arm64 and s390x -- implemented chacha using instructions
that are available most places, but aren't always available. The kernel
handles this just fine, but the selftest does not. Check the hwcaps
before running, and skip the test if the cpu doesn't support it. As
well, on s390x, always emit the fallback instructions of an alternative
block, to ensure maximum compatibility.

Co-developed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
tools/include/asm/alternative.h
tools/testing/selftests/vDSO/vdso_test_chacha.c