From nobody Thu Oct 2 23:57:53 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37C3C274B4B; Tue, 9 Sep 2025 09:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757408559; cv=none; b=HT3vCffNzmlIqfGVjqNl9ePUCIsP4oevP+IwJ3PM/gpt1uk/yJNGYxEZKTV64tVJdbNVnSQglXYMR5uAa+/J2IBBrTMROcln5JZCk3ZmweCxd5qoncgKsZKd9Cl7Ob/6J5toc1rn3PCZK+ezd9cp4d9gZG3ZR8zxFcgOl88xxCo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757408559; c=relaxed/simple; bh=EYujByv4V9ZG0GllD9DtQbKDO7NmvVom2rDf1wMMmlU=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=sroozVt1Uq6wwS+bAgAM0reO9UiZuRDk+Sx2dV4HcPCQ8TRHK664cUXh98MxzRn9UX+cs4TpwI71cjuYeHLJXeY/dKqw3Lgxh0GSrycv6/mymnW4sO6IXtELPicssDfIBdJDYGRd13AQq7FnIe8VkTVK6c2kyxBJ9bZFn7oy2SM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=SmACBJ29; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dSMrfdU9; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="SmACBJ29"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dSMrfdU9" Date: Tue, 09 Sep 2025 09:02:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1757408555; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iOFYLr8DB1r6PwoZxn/PCb/cniatYwxugs7wnNXPRdE=; b=SmACBJ29iejTuRucIoj4Zu6zEEY4hOcBBfAHa159tGBMn/nriaJTsHHjfaxRfXmlyJpLA5 Uy6HN7ijwlb7MneE0t0EA4V7izgyGXsVoiTRuLZvqoLZFbpyR6k9pEHmUecudYFbMGmGqO O44Y4ZaK9DOQR/CEV315Jkw0YzLbeet5zQWF1usg4/a5nF55i1DMULNrpXHSFSa3+MPUlN 2IsFcZCII4YSnsrFdUmxmQWY+Onuarfs+Q0Rv8QSr8KkKdV629OMvQPHZwa9Cf0rhRgtey JcNYZEErbS5RrErrqHLCUm1V7E9TZVk9x7krglmFSIFirnYOoyn8Vz0GBJ44qA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1757408555; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iOFYLr8DB1r6PwoZxn/PCb/cniatYwxugs7wnNXPRdE=; b=dSMrfdU9QLoZFuVKDKkE9KJ1RPrsUBBl6qdNBVgBeWcvspE7tQllWKx+34fQKyXIOm8Jgl ivPmqe+WP5S1yrCQ== From: tip-bot2 for Thomas =?utf-8?q?Wei=C3=9Fschuh?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/vdso] selftests: vDSO: vdso_test_abi: Add tests for clock_gettime64() Cc: thomas.weissschuh@linutronix.de, Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250812-vdso-tests-fixes-v2-7-90f499dd35f8@linutronix.de> References: <20250812-vdso-tests-fixes-v2-7-90f499dd35f8@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <175740855429.1920.706092513218745463.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the timers/vdso branch of tip: Commit-ID: 7262aa781fea89cc388335e9c5c6701d8bb13d42 Gitweb: https://git.kernel.org/tip/7262aa781fea89cc388335e9c5c6701d8= bb13d42 Author: Thomas Wei=C3=9Fschuh AuthorDate: Tue, 12 Aug 2025 07:39:08 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 09 Sep 2025 10:57:39 +02:00 selftests: vDSO: vdso_test_abi: Add tests for clock_gettime64() To be y2038-safe, 32-bit userspace needs to explicitly call the 64-bit safe time APIs. For this the 32-bit vDSOs contains a clock_gettime() variant which always uses 64-bit time types. Also test this vDSO function. Signed-off-by: Thomas Wei=C3=9Fschuh Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/all/20250812-vdso-tests-fixes-v2-7-90f499dd35= f8@linutronix.de --- tools/testing/selftests/vDSO/vdso_test_abi.c | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/s= elftests/vDSO/vdso_test_abi.c index c25f099..238d609 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -26,8 +26,15 @@ static const char *version; static const char **name; =20 +/* The same as struct __kernel_timespec */ +struct vdso_timespec64 { + uint64_t tv_sec; + uint64_t tv_nsec; +}; + typedef long (*vdso_gettimeofday_t)(struct timeval *tv, struct timezone *t= z); typedef long (*vdso_clock_gettime_t)(clockid_t clk_id, struct timespec *ts= ); +typedef long (*vdso_clock_gettime64_t)(clockid_t clk_id, struct vdso_times= pec64 *ts); typedef long (*vdso_clock_getres_t)(clockid_t clk_id, struct timespec *ts); typedef time_t (*vdso_time_t)(time_t *t); =20 @@ -70,6 +77,33 @@ static void vdso_test_gettimeofday(void) } } =20 +static void vdso_test_clock_gettime64(clockid_t clk_id) +{ + /* Find clock_gettime64. */ + vdso_clock_gettime64_t vdso_clock_gettime64 =3D + (vdso_clock_gettime64_t)vdso_sym(version, name[5]); + + if (!vdso_clock_gettime64) { + ksft_print_msg("Couldn't find %s\n", name[5]); + ksft_test_result_skip("%s %s\n", name[5], + vdso_clock_name[clk_id]); + return; + } + + struct vdso_timespec64 ts; + long ret =3D VDSO_CALL(vdso_clock_gettime64, 2, clk_id, &ts); + + if (ret =3D=3D 0) { + ksft_print_msg("The time is %lld.%06lld\n", + (long long)ts.tv_sec, (long long)ts.tv_nsec); + ksft_test_result_pass("%s %s\n", name[5], + vdso_clock_name[clk_id]); + } else { + ksft_test_result_fail("%s %s\n", name[5], + vdso_clock_name[clk_id]); + } +} + static void vdso_test_clock_gettime(clockid_t clk_id) { /* Find clock_gettime. */ @@ -171,11 +205,12 @@ static inline void vdso_test_clock(clockid_t clock_id) ksft_print_msg("clock_id: %s\n", vdso_clock_name[clock_id]); =20 vdso_test_clock_gettime(clock_id); + vdso_test_clock_gettime64(clock_id); =20 vdso_test_clock_getres(clock_id); } =20 -#define VDSO_TEST_PLAN 20 +#define VDSO_TEST_PLAN 29 =20 int main(int argc, char **argv) {