selftests: vDSO: unconditionally build getrandom test
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 7 Oct 2024 21:45:57 +0000 (23:45 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 8 Oct 2024 21:21:36 +0000 (15:21 -0600)
Rather than building on supported archs, build on all archs, and then
use the presence of the symbol in the vDSO to either skip the test or
move forward with it.

Note that this means that this test no longer checks whether the symbol
was correctly added to the kernel. But hopefully this will be clear
enough to developers and we'll cross our fingers that symbols aren't
removed by accident and not caught after this change.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/vDSO/Makefile
tools/testing/selftests/vDSO/vdso_test_getrandom.c

index 4564138..1cf14a8 100644 (file)
@@ -9,9 +9,7 @@ ifeq ($(ARCH),$(filter $(ARCH),x86 x86_64))
 TEST_GEN_PROGS += vdso_standalone_test_x86
 endif
 TEST_GEN_PROGS += vdso_test_correctness
-ifeq ($(ARCH)$(CONFIG_X86_32),$(filter $(ARCH)$(CONFIG_X86_32),x86 x86_64 loongarch arm64 powerpc s390))
 TEST_GEN_PROGS += vdso_test_getrandom
-endif
 TEST_GEN_PROGS += vdso_test_chacha
 
 CFLAGS := -std=gnu99 -O2
index e5e83db..95ec894 100644 (file)
@@ -121,7 +121,7 @@ static void vgetrandom_init(void)
        vgrnd.fn = (__typeof__(vgrnd.fn))vdso_sym(version, name);
        if (!vgrnd.fn) {
                printf("%s is missing!\n", name);
-               exit(KSFT_FAIL);
+               exit(KSFT_SKIP);
        }
        ret = VDSO_CALL(vgrnd.fn, 5, NULL, 0, 0, &vgrnd.params, ~0UL);
        if (ret == -ENOSYS) {