[PATCH 3/5] selftests: vDSO: vdso_test_abi: Drop the getres syscall comparisons
From: Thomas Weißschuh
Date: Sat Dec 05 2026 - 09:34:43 EST
It is not vdso_test_abi's task to ensure the consistency between the
syscall and vDSO paths. For this vdso_test_correctness exists.
Drop the out-of-place checks.
Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
---
tools/testing/selftests/vDSO/vdso_test_abi.c | 43 ++++------------------------
1 file changed, 6 insertions(+), 37 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/selftests/vDSO/vdso_test_abi.c
index 3e4eea19cd50..7c0f79f64733 100644
--- a/tools/testing/selftests/vDSO/vdso_test_abi.c
+++ b/tools/testing/selftests/vDSO/vdso_test_abi.c
@@ -16,7 +16,6 @@
#include <sys/time.h>
#define _GNU_SOURCE
#include <unistd.h>
-#include <sys/syscall.h>
#include "kselftest.h"
#include "vdso_config.h"
@@ -177,8 +176,6 @@ static void vdso_test_time(void)
static void vdso_test_clock_getres(clockid_t clk_id)
{
- int clock_getres_fail = 0;
-
/* Find clock_getres. */
vdso_clock_getres_t vdso_clock_getres =
(vdso_clock_getres_t)vdso_sym(version, name[3]);
@@ -190,29 +187,16 @@ static void vdso_test_clock_getres(clockid_t clk_id)
return;
}
- struct timespec ts, sys_ts;
+ struct timespec ts;
long ret = VDSO_CALL(vdso_clock_getres, 2, clk_id, &ts);
if (ret == 0) {
ksft_print_msg("The vdso resolution is %lld %lld\n",
(long long)ts.tv_sec, (long long)ts.tv_nsec);
- } else {
- clock_getres_fail++;
- }
-
- ret = syscall(__NR_clock_getres, clk_id, &sys_ts);
-
- ksft_print_msg("The syscall resolution is %lld %lld\n",
- (long long)sys_ts.tv_sec, (long long)sys_ts.tv_nsec);
-
- if ((sys_ts.tv_sec != ts.tv_sec) || (sys_ts.tv_nsec != ts.tv_nsec))
- clock_getres_fail++;
-
- if (clock_getres_fail > 0) {
- ksft_test_result_fail("%s %s\n", name[3],
+ ksft_test_result_pass("%s %s\n", name[3],
vdso_clock_name[clk_id]);
} else {
- ksft_test_result_pass("%s %s\n", name[3],
+ ksft_test_result_fail("%s %s\n", name[3],
vdso_clock_name[clk_id]);
}
}
@@ -220,8 +204,6 @@ static void vdso_test_clock_getres(clockid_t clk_id)
#ifdef __NR_clock_getres_time64
static void vdso_test_clock_getres_time64(clockid_t clk_id)
{
- int clock_getres_fail = 0;
-
/* Find clock_getres. */
vdso_clock_getres_time64_t vdso_clock_getres_time64 =
(vdso_clock_getres_time64_t)vdso_sym(version, name[7]);
@@ -233,29 +215,16 @@ static void vdso_test_clock_getres_time64(clockid_t clk_id)
return;
}
- struct vdso_timespec64 ts, sys_ts;
+ struct vdso_timespec64 ts;
long ret = VDSO_CALL(vdso_clock_getres_time64, 2, clk_id, &ts);
if (ret == 0) {
ksft_print_msg("The vdso resolution is %lld %lld\n",
(long long)ts.tv_sec, (long long)ts.tv_nsec);
- } else {
- clock_getres_fail++;
- }
-
- ret = syscall(__NR_clock_getres_time64, clk_id, &sys_ts);
-
- ksft_print_msg("The syscall resolution is %lld %lld\n",
- (long long)sys_ts.tv_sec, (long long)sys_ts.tv_nsec);
-
- if ((sys_ts.tv_sec != ts.tv_sec) || (sys_ts.tv_nsec != ts.tv_nsec))
- clock_getres_fail++;
-
- if (clock_getres_fail > 0) {
- ksft_test_result_fail("%s %s\n", name[7],
+ ksft_test_result_pass("%s %s\n", name[7],
vdso_clock_name[clk_id]);
} else {
- ksft_test_result_pass("%s %s\n", name[7],
+ ksft_test_result_fail("%s %s\n", name[7],
vdso_clock_name[clk_id]);
}
}
--
2.56.1