Skip to content

Commit fe6305c

Browse files
zx2c4shuahkh
authored andcommitted
selftests: vDSO: unconditionally build getrandom test
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 <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 3b5992e commit fe6305c

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

tools/testing/selftests/vDSO/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ ifeq ($(ARCH),$(filter $(ARCH),x86 x86_64))
99
TEST_GEN_PROGS += vdso_standalone_test_x86
1010
endif
1111
TEST_GEN_PROGS += vdso_test_correctness
12-
ifeq ($(ARCH)$(CONFIG_X86_32),$(filter $(ARCH)$(CONFIG_X86_32),x86 x86_64 loongarch arm64 powerpc s390))
1312
TEST_GEN_PROGS += vdso_test_getrandom
14-
endif
1513
TEST_GEN_PROGS += vdso_test_chacha
1614

1715
CFLAGS := -std=gnu99 -O2

tools/testing/selftests/vDSO/vdso_test_getrandom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static void vgetrandom_init(void)
121121
vgrnd.fn = (__typeof__(vgrnd.fn))vdso_sym(version, name);
122122
if (!vgrnd.fn) {
123123
printf("%s is missing!\n", name);
124-
exit(KSFT_FAIL);
124+
exit(KSFT_SKIP);
125125
}
126126
ret = VDSO_CALL(vgrnd.fn, 5, NULL, 0, 0, &vgrnd.params, ~0UL);
127127
if (ret == -ENOSYS) {

0 commit comments

Comments
 (0)