Skip to content

Commit a0482e3

Browse files
committed
Merge tag 'timers-vdso-2025-07-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull VDSO selftest updates from Thomas Gleixner: - Skip the chacha test when the architecture does not provide the random infrastructure in the VDSO - Switch back to a symlink for vdso_standalone_test_x86 to avoid code duplication. - Improve code quality and TAP output compliance * tag 'timers-vdso-2025-07-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: selftests: vDSO: vdso_standalone_test_x86: Replace source file with symlink selftests: vDSO: vdso_test_getrandom: Always print TAP header selftests: vDSO: vdso_test_correctness: Fix -Wstrict-prototypes selftests: vDSO: Enable -Wall selftests: vDSO: vdso_config: Avoid -Wunused-variables selftests: vDSO: vdso_test_getrandom: Avoid -Wunused selftests: vDSO: vdso_test_getrandom: Drop unused include of linux/compiler.h selftests: vDSO: clock_getres: Drop unused include of err.h selftests: vDSO: chacha: Correctly skip test if necessary
2 parents f38b1f2 + 4370796 commit a0482e3

File tree

7 files changed

+13
-66
lines changed

7 files changed

+13
-66
lines changed

tools/testing/selftests/vDSO/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ TEST_GEN_PROGS += vdso_test_correctness
1212
TEST_GEN_PROGS += vdso_test_getrandom
1313
TEST_GEN_PROGS += vdso_test_chacha
1414

15-
CFLAGS := -std=gnu99 -O2
15+
CFLAGS := -std=gnu99 -O2 -Wall -Wstrict-prototypes
1616

1717
ifeq ($(CONFIG_X86_32),y)
1818
LDLIBS += -lgcc_s

tools/testing/selftests/vDSO/vdso_config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#define VDSO_NAMES 1
5959
#endif
6060

61+
__attribute__((unused))
6162
static const char *versions[7] = {
6263
"LINUX_2.6",
6364
"LINUX_2.6.15",
@@ -68,6 +69,7 @@ static const char *versions[7] = {
6869
"LINUX_5.10"
6970
};
7071

72+
__attribute__((unused))
7173
static const char *names[2][7] = {
7274
{
7375
"__kernel_gettimeofday",

tools/testing/selftests/vDSO/vdso_standalone_test_x86.c

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vdso_test_gettimeofday.c

tools/testing/selftests/vDSO/vdso_test_chacha.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ static void reference_chacha20_blocks(uint8_t *dst_bytes, const uint32_t *key, u
7676

7777
void __weak __arch_chacha20_blocks_nostack(uint8_t *dst_bytes, const uint32_t *key, uint32_t *counter, size_t nblocks)
7878
{
79-
ksft_exit_skip("Not implemented on architecture\n");
79+
ksft_test_result_skip("Not implemented on architecture\n");
80+
ksft_finished();
8081
}
8182

8283
int main(int argc, char *argv[])

tools/testing/selftests/vDSO/vdso_test_clock_getres.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#define _GNU_SOURCE
1515
#include <elf.h>
16-
#include <err.h>
1716
#include <fcntl.h>
1817
#include <stdint.h>
1918
#include <stdio.h>

tools/testing/selftests/vDSO/vdso_test_correctness.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static void *vsyscall_getcpu(void)
108108
}
109109

110110

111-
static void fill_function_pointers()
111+
static void fill_function_pointers(void)
112112
{
113113
void *vdso = dlopen("linux-vdso.so.1",
114114
RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD);

tools/testing/selftests/vDSO/vdso_test_getrandom.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <sys/wait.h>
2222
#include <sys/types.h>
2323
#include <linux/random.h>
24-
#include <linux/compiler.h>
2524
#include <linux/ptrace.h>
2625

2726
#include "../kselftest.h"
@@ -101,6 +100,7 @@ static void *vgetrandom_get_state(void)
101100
return state;
102101
}
103102

103+
__attribute__((unused)) /* Example for libc implementors */
104104
static void vgetrandom_put_state(void *state)
105105
{
106106
if (!state)
@@ -242,6 +242,7 @@ static void kselftest(void)
242242
pid_t child;
243243

244244
ksft_print_header();
245+
vgetrandom_init();
245246
ksft_set_plan(2);
246247

247248
for (size_t i = 0; i < 1000; ++i) {
@@ -265,7 +266,7 @@ static void kselftest(void)
265266
}
266267
for (;;) {
267268
struct ptrace_syscall_info info = { 0 };
268-
int status, ret;
269+
int status;
269270
ksft_assert(waitpid(child, &status, 0) >= 0);
270271
if (WIFEXITED(status)) {
271272
ksft_assert(WEXITSTATUS(status) == 0);
@@ -295,8 +296,6 @@ static void usage(const char *argv0)
295296

296297
int main(int argc, char *argv[])
297298
{
298-
vgetrandom_init();
299-
300299
if (argc == 1) {
301300
kselftest();
302301
return 0;
@@ -306,6 +305,9 @@ int main(int argc, char *argv[])
306305
usage(argv[0]);
307306
return 1;
308307
}
308+
309+
vgetrandom_init();
310+
309311
if (!strcmp(argv[1], "bench-single"))
310312
bench_single();
311313
else if (!strcmp(argv[1], "bench-multi"))

0 commit comments

Comments
 (0)