From nobody Sun Feb 8 19:43:31 2026 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 63114350D53; Tue, 11 Nov 2025 10:50:00 +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=1762858202; cv=none; b=iXDFWuIQ6DZIJBVQmraY7A9iLDqjRpGt4obQZP2qPTpZtw8ZmsGvePLxUghmaNK/nOookBRIAcUUJsGR/C6LseecpJkllHXVWsEcN3lLa4QaxwQ6HC4fRRC9HZXpxeekrm61w0YRS/KTy9RmBG1x8Qc7eo10uQ7hEkoeDKhH9b4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762858202; c=relaxed/simple; bh=Q5mSZf+7MhMKjYa8bZA1DaNfmC77pb9wgo99bPVZlqs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WsoL+NqSfWZ8pxU2CaUWgakkbRC8CZyf2K8TTMCMppyjB9p84EkIK6eqQfaobCeNarlfPc+jGhVAiIPq+V5byom5ZO943YLhDmUUcACPiEQj39r0qZIhnVAScb5eGzLSCM4nQKZpPdXjeIMuHk8ylpNPmwcdhUq346liDMwg4Y4= 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=N9ryGHdT; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=VdU1bGAo; 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="N9ryGHdT"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="VdU1bGAo" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762858198; h=from:from: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=PJP89vqyADPfhvP8ZPlnau0zbtJnEIPmJb5qcOrBLl8=; b=N9ryGHdTJNSCEOFCRPejU6S6912qeS0LBGEAelBVg39o+74wjqoUpmMKFSDx2s9dP4EQxx 4WwZK3ST1bWZsEJtWm7ZvNeYgqVNwkRyHenvjGfrFA0mG4kxl7ZRfXHnbXEh+c8UoNXxgU bkDrFFOMykvyetLuP0uOxl8bclE9PQDqcMzMpdSZ07FSsKyr1OKbHJOz/QUN8MS3GEykEd i6DMqnee6GHoz6PxLxiBbIQnc9e7hSE3CH4IS4uYJWRKOMJe2bO4H4FB1tJoGJdVQ37GuH ++2ReVomecAeH7Q17Rzts8931eK5DkE2q4cVad/zzbwDYV0hOPQhbNpnH4qEMQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762858198; h=from:from: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=PJP89vqyADPfhvP8ZPlnau0zbtJnEIPmJb5qcOrBLl8=; b=VdU1bGAoGNPvTs9Rwcf6r/Q26xqbH6qxXwzd+C5kyWBBBRCCeSxwgRBKmnH3sR2d+D6Jos 6tudacrMRm8B2qCA== Date: Tue, 11 Nov 2025 11:49:47 +0100 Subject: [PATCH 01/10] Revert "selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251111-vdso-test-types-v1-1-03b31f88c659@linutronix.de> References: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> In-Reply-To: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762858197; l=1846; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Q5mSZf+7MhMKjYa8bZA1DaNfmC77pb9wgo99bPVZlqs=; b=3Hxec+pMUmgW55M4lF1EHCA4py0Rxp1o2wPLKdTKj3wPLG0qb3mccUJRf6JQ/2L2GbmuKeqJA k79gvz/2fngBUm7H2JtjayZgq94eIbrx8nxlGsgAOMzoQMHpmhaN7cW X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= This reverts commit c9fbaa879508 ("selftests: vDSO: parse_vdso: Use UAPI headers instead of libc headers") The kernel headers were used to make parse_vdso.c compatible with nolibc. Unfortunately linux/elf.h is incompatible with glibc's sys/auxv.h. When using glibc it is therefore not possible build parse_vdso.c as part of the same compilation unit as its caller as sys/auxv.h is needed for getauxval(). In the meantime nolibc gained its own elf.h, providing compatibility with the documented libc interfaces. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/Makefile | 2 -- tools/testing/selftests/vDSO/parse_vdso.c | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftest= s/vDSO/Makefile index e361aca22a74dc5c279ab1aa16f308b7e6e85bf1..2de5cef311c8ab695606cf7f408= c04910842e377 100644 --- a/tools/testing/selftests/vDSO/Makefile +++ b/tools/testing/selftests/vDSO/Makefile @@ -19,8 +19,6 @@ endif =20 include ../lib.mk =20 -CFLAGS +=3D $(TOOLS_INCLUDES) - CFLAGS_NOLIBC :=3D -nostdlib -nostdinc -ffreestanding -fno-asynchronous-un= wind-tables \ -fno-stack-protector -include $(top_srcdir)/tools/include/nolibc/nolibc= .h \ -I$(top_srcdir)/tools/include/nolibc/ $(KHDR_INCLUDES) diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/self= tests/vDSO/parse_vdso.c index 3ff00fb624a44b964cc54954f1f088cabe11a901..c6ff4413ea367ae57bc6a600733= 14b29f938c99d 100644 --- a/tools/testing/selftests/vDSO/parse_vdso.c +++ b/tools/testing/selftests/vDSO/parse_vdso.c @@ -19,8 +19,7 @@ #include #include #include -#include -#include +#include =20 #include "parse_vdso.h" =20 --=20 2.51.0 From nobody Sun Feb 8 19:43:31 2026 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 6352E350D5A; Tue, 11 Nov 2025 10:50:00 +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=1762858203; cv=none; b=Ahw+N3q7Lzi64Ozakf1FkHFQBQDFLAIRAKIbmBq08gWor8UiNn8DDvWZWPhfrnvJbYdjCDKx11dJzqQfczft6amSv9Wu8UEjHhB51lgTgTbhXd8SI/29FTFL8SZIjzSV9GKTkiVlIDVAucqnINSzGDAeR/EiNLFIPrdz2mJSdPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762858203; c=relaxed/simple; bh=EeRfykXVankngUAY1jUwatWYcaIYufS5aUaNTFHkrCg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SVug6U2tzgc5X6NbT9qtTAEl9GDRrZcE+H9Yh5SEZdX1mrS9o+tvCmQlpJ9NDCFRw7z5k+syB1b73dwbbtPkrusOKYt179OOfCR+JlgM2D9JOer8XeuS32ncDQfFAA2E2oHkyEZUqaLe4ZdmcXF9rgnI802pjmGoXpedFQBncuc= 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=P5e54xKS; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=n33Hzt/9; 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="P5e54xKS"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="n33Hzt/9" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762858199; h=from:from: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=ds70ShsrdVFkzMZTRTLjKAoAYskQWlHPQmsTM1PrMXA=; b=P5e54xKSriztzJLgGI7sJN/mdzGBk5PmMEMo6Ek/3oa+fl21nSDZdTPTV4y17hLPBR2R7P AtKxnS0/C3O/sp2XTQGaGm6BUDduHys3fOWJnl3MFA4rSrKgsnN/0zIdM2vbJFg0sz3xPo njc2b08Pz96ky6GtG+K6Yqh76LEHnP9qFLsT+eekieI43QzIfHhU7gHtt2GN/0rdGSqDS4 98/wFmjgv7jNNGbJq7GXG8UY4lFpg05jB5zRLDJAcqNAi6rYk36yjKTyeFAsiDhfpt3xII cdotFsHZ/vyGyrWLT9Ynbq7IsbgXdorfqen1I2re77o0dMNr1Qowf6uvOSLeSQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762858199; h=from:from: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=ds70ShsrdVFkzMZTRTLjKAoAYskQWlHPQmsTM1PrMXA=; b=n33Hzt/9DvaTv1I/f6y/aiGikjPjU2MQLQUK1Ty4iT7YCDwcj0VHu22SxYyHr9k+9NLgod reL2M9PX9/lHeJAQ== Date: Tue, 11 Nov 2025 11:49:48 +0100 Subject: [PATCH 02/10] selftests: vDSO: Introduce vdso_types.h Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251111-vdso-test-types-v1-2-03b31f88c659@linutronix.de> References: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> In-Reply-To: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762858197; l=3183; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=EeRfykXVankngUAY1jUwatWYcaIYufS5aUaNTFHkrCg=; b=rKRYcnJzwEO9AKks9K4hWcrKlP7AwyskDHYBDIhzj2Ri7n8VosOQ245VtxBldIJwgz6lzivCf nZ2MTPvF22mCql9+FvMZMJ0mjelBHHvBl7in7WdXJ9HYiA9wylUzBI8 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Currently the vDSO selftests use the time-related types from libc. This works on glibc by chance today but will break with other libc implementations or on distributions which switch to 64-bit times everywhere. The kernel's UAPI headers provide the proper types to use with the vDSO (and raw syscalls) but are not necessarily compatible with libc types. Introduce a new header which makes the UAPI headers compatible with the libc. Tested with glibc, musl and nolibc. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_types.h | 70 +++++++++++++++++++++++++++= ++++ 1 file changed, 70 insertions(+) diff --git a/tools/testing/selftests/vDSO/vdso_types.h b/tools/testing/self= tests/vDSO/vdso_types.h new file mode 100644 index 0000000000000000000000000000000000000000..a1f2f5412e813d5ba6e57a87e28= b9eacc68cccac --- /dev/null +++ b/tools/testing/selftests/vDSO/vdso_types.h @@ -0,0 +1,70 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) 2025 Thomas Wei=C3=9Fschuh , Linutronix GmbH + * + * Types to use with vDSO functions. + * + * The types used by the vDSO functions do not necessarily match the ones = used + * by libc. The kernel's UAPI headers do provide definitions for those typ= es + * but are often not compatible with libc which applications need to use. + * As the types differ between platforms listing them manually is a lot of= work + * and error prone. Instead hack around the incompatibilities of the libc = and + * UAPI headers and use the UAPI types. + */ +#ifndef __VDSO_TYPES_H__ +#define __VDSO_TYPES_H__ + +/* + * Include the headers from libc first to not override any of its types la= ter. + */ +#include +#include + +/* + * Avoid collisions. + */ +#define timeval kernel_timeval_moved +#define itimerspec kernel_itimerspec_moved +#define itimerval kernel_itimerval_moved +#define timezone kernel_timezone_moved + +/* + * Get the UAPI types. + */ +#include + +#undef timeval +#undef itimerspec +#undef itimerval +#undef timezone + +/* + * The UAPI headers do not provide their own 'struct __kernel_timezone'. + * 'struct timezone' is the one from libc. + */ +struct kernel_timezone { + int tz_minuteswest; + int tz_dsttime; +}; + +#include + +/* + * UAPI headers from the libc may be older and not provide these. + */ +#if KERNEL_VERSION(5, 5, 0) > LINUX_VERSION_CODE +typedef __kernel_long_t __kernel_old_time_t; + +struct __kernel_old_timespec { + __kernel_old_time_t tv_sec; + long tv_nsec; +}; +#endif + +typedef long (*vdso_gettimeofday_t)(struct __kernel_old_timeval *tv, struc= t kernel_timezone *tz); +typedef long (*vdso_clock_gettime_t)(__kernel_clockid_t clk_id, struct __k= ernel_old_timespec *ts); +typedef long (*vdso_clock_gettime64_t)(__kernel_clockid_t clk_id, struct _= _kernel_timespec *ts); +typedef long (*vdso_clock_getres_t)(__kernel_clockid_t clk_id, struct __ke= rnel_old_timespec *ts); +typedef __kernel_time_t (*vdso_time_t)(__kernel_time_t *t); + +#endif /* __VDSO_TYPES_H__ */ --=20 2.51.0 From nobody Sun Feb 8 19:43:31 2026 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 B77EC3546F9; Tue, 11 Nov 2025 10:50:01 +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=1762858204; cv=none; b=biqC7xhwAmRqYmFM5zMyqJ2i2dy51nodH/3L6VXzSCx6U8ECKpVkV6VGE9IUDdNpxtSsSYRIJodrF+RFDcgYkiXPEjwcP4irBhp25ur6yhwtpJikRHABuvJw61DCKCkoGLVMJSUVooLR7KtCzBuf7prOyLPapuvTTpiWOFFFnkc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762858204; c=relaxed/simple; bh=5Hn+l/oBMVRfdyJe6BkNTEVt5vhJRrf/zIY7pQXzK90=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aOkMoGSRgte/RtDEdXBx3cI7V+7iYg9CQvOZkotbnvmZeuk/XCqRIe/w4FUCMlGkmaxCw80/OHAUR27apDI7bNAZAYgKwkC16ofpjGYN0CvNWHF0mTLjNjm1zKnrijZZit0Kl9XS+kEW/YQDK0jVrsN5dyTZE45YwiaWX1AP6Xs= 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=pDbXbcOO; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=NPEeB1Mn; 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="pDbXbcOO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NPEeB1Mn" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762858200; h=from:from: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=6/vqzdI5QT7M45iFthhBxx7Jy0esRcYVB8/VtVM6c2g=; b=pDbXbcOO87U8I4+64jjIX8+6wYSCh196Wkc+kjunLlwbR+Ct4TMJOfv2/+IF3kh3b4BoMN yhoHPng6wfiU5NHPO6FGdIZ7Jg/4nEmNnp6ZJXA3rrEhs0MVuOJwUD2ZuxBMGWLkBSa/Ys i8mlKev4VvP9GRV1dly7G7krjEqDNVEOpympd/x/s7sGv3xQbLszW4qjq8wkQuchmJtpTK NmtTbwCQXA2TR6oAoM5CG0N84TqrwWyC22nTKzeGIo5KgZSxLSghzuhmhXGRSNqjmlY/Hh FW1VJC03gqrgj/DSv8CyBLhBLDeOhikxoCmzozVdYrvWaSyUHuoGHQ5aidwtZg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762858200; h=from:from: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=6/vqzdI5QT7M45iFthhBxx7Jy0esRcYVB8/VtVM6c2g=; b=NPEeB1Mn7uYlkqPrCET8xCKB+9U0s8X854nxZWesU461x4ULkCNZQuIBXa7sqqdtEsadjc 5anfP7/Ltq7wGqAQ== Date: Tue, 11 Nov 2025 11:49:49 +0100 Subject: [PATCH 03/10] selftests: vDSO: vdso_test_abi: Use types from vdso_types.h Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251111-vdso-test-types-v1-3-03b31f88c659@linutronix.de> References: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> In-Reply-To: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762858197; l=3846; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=5Hn+l/oBMVRfdyJe6BkNTEVt5vhJRrf/zIY7pQXzK90=; b=cdYgdYHgXwWfYyhKQvFSC72qvkltTbhFOFvdBOZbbWNJQ5N2f+H6XR9rHTHzL1VCwfamIZIO2 YdZd2dEf6sPAPKiNX5AahxKoWneupJREznmg4iwvK1QXKBuw3KwpPQR X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The libc types are not necessarily compatible with the vDSO functions. Use the dedicated types from vdso_types.h instead. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_abi.c | 31 ++++++++----------------= ---- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/s= elftests/vDSO/vdso_test_abi.c index 238d609a457a281d802734b40d6a2c35ba7f6d72..bb5a5534ae7e8a46d7e68a56168= 4c29a752b866d 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -11,9 +11,7 @@ #include #include #include -#include #include -#include #define _GNU_SOURCE #include #include @@ -21,23 +19,12 @@ #include "../kselftest.h" #include "vdso_config.h" #include "vdso_call.h" +#include "vdso_types.h" #include "parse_vdso.h" =20 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); - static const char * const vdso_clock_name[] =3D { [CLOCK_REALTIME] =3D "CLOCK_REALTIME", [CLOCK_MONOTONIC] =3D "CLOCK_MONOTONIC", @@ -65,7 +52,7 @@ static void vdso_test_gettimeofday(void) return; } =20 - struct timeval tv; + struct __kernel_old_timeval tv; long ret =3D VDSO_CALL(vdso_gettimeofday, 2, &tv, 0); =20 if (ret =3D=3D 0) { @@ -77,7 +64,7 @@ static void vdso_test_gettimeofday(void) } } =20 -static void vdso_test_clock_gettime64(clockid_t clk_id) +static void vdso_test_clock_gettime64(__kernel_clockid_t clk_id) { /* Find clock_gettime64. */ vdso_clock_gettime64_t vdso_clock_gettime64 =3D @@ -90,7 +77,7 @@ static void vdso_test_clock_gettime64(clockid_t clk_id) return; } =20 - struct vdso_timespec64 ts; + struct __kernel_timespec ts; long ret =3D VDSO_CALL(vdso_clock_gettime64, 2, clk_id, &ts); =20 if (ret =3D=3D 0) { @@ -104,7 +91,7 @@ static void vdso_test_clock_gettime64(clockid_t clk_id) } } =20 -static void vdso_test_clock_gettime(clockid_t clk_id) +static void vdso_test_clock_gettime(__kernel_clockid_t clk_id) { /* Find clock_gettime. */ vdso_clock_gettime_t vdso_clock_gettime =3D @@ -117,7 +104,7 @@ static void vdso_test_clock_gettime(clockid_t clk_id) return; } =20 - struct timespec ts; + struct __kernel_old_timespec ts; long ret =3D VDSO_CALL(vdso_clock_gettime, 2, clk_id, &ts); =20 if (ret =3D=3D 0) { @@ -154,7 +141,7 @@ static void vdso_test_time(void) } } =20 -static void vdso_test_clock_getres(clockid_t clk_id) +static void vdso_test_clock_getres(__kernel_clockid_t clk_id) { int clock_getres_fail =3D 0; =20 @@ -169,7 +156,7 @@ static void vdso_test_clock_getres(clockid_t clk_id) return; } =20 - struct timespec ts, sys_ts; + struct __kernel_old_timespec ts, sys_ts; long ret =3D VDSO_CALL(vdso_clock_getres, 2, clk_id, &ts); =20 if (ret =3D=3D 0) { @@ -200,7 +187,7 @@ static void vdso_test_clock_getres(clockid_t clk_id) * This function calls vdso_test_clock_gettime and vdso_test_clock_getres * with different values for clock_id. */ -static inline void vdso_test_clock(clockid_t clock_id) +static inline void vdso_test_clock(__kernel_clockid_t clock_id) { ksft_print_msg("clock_id: %s\n", vdso_clock_name[clock_id]); =20 --=20 2.51.0 From nobody Sun Feb 8 19:43:31 2026 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 9702635470A; Tue, 11 Nov 2025 10:50:02 +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=1762858205; cv=none; b=ACRiOw8Zgb2iKrAG8aqzJYjpxbBjYSkxhfur0xQmVA6LKEfkZLHtB8qM0JeFni2hfHa6i48K+SUVNprOUVRHszwoQAPFzETi3XHYS8DBTnCSuoDh1kT9LuGvJfubEcrZQ5USyZrmSzG2aXkiys73OVathbZl+4nsr9aYVqUjepA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762858205; c=relaxed/simple; bh=xj97LjnkpZXwOaVKrKnQFjnvVZvSP4GS9N09KI7Aj8M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SqQ/JJaP2CcvhC0yKD3NzbrgD53inTmTbecDN4OILbmNfCy4wjjI+HRgwo3HyCO05uAVzitfAL0mroJyaEAqLM6u6XUb8TqFlqnQMaH0WubrPxAXB2R28XAZNWsx1iU3EW9nnnl29McsuYw4N5FAlvM4l2O3S5oBtENhIRXkeBg= 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=r72c0LL0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LKCjCSwp; 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="r72c0LL0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LKCjCSwp" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762858200; h=from:from: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=75wyZV/JgSFGjOOw2HZQaIX8t+5lodFpKe8oY/EEK3o=; b=r72c0LL0o4jpfXtGhN17ap4a2vv+9YYspOhmVEGSdk5D69wV8ByTFMEI4Psjce7QI+VZSW BdLwIDsZCJm8Tp9BPc6M4MqiyTOTwDPFsCW+tc3rCOsU32CZx2rrBaBFrQD00UeBEmvkX7 cNQraZjlfzfpGCJVZDN8gBM8YO2sQrHsDdl17PwpWXLhGNdEjD6MslGkql4hqcVEP2NH/j RZvmN/JkmjLPP0lpAGjCqWDeK6a7GWPtoMQUb1uBj+Vczc4WELBIXwai054Mm3tmXDwo/F Tam8KP+9WvnT7pMHO/oc59TcGVhwrCx+ArwX+xNvk+A7LpbDqtjN1A+1PRERoQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762858200; h=from:from: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=75wyZV/JgSFGjOOw2HZQaIX8t+5lodFpKe8oY/EEK3o=; b=LKCjCSwp8E5WRgIAEwIJBTkvzYMKdpnyzXFyPp+ScpK3C2utczT1dXEEQPtMP3X3nZBiUG 8LheUGktxq38m7Cg== Date: Tue, 11 Nov 2025 11:49:50 +0100 Subject: [PATCH 04/10] selftests: vDSO: vdso_test_abi: Provide compatibility with 32-bit musl Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251111-vdso-test-types-v1-4-03b31f88c659@linutronix.de> References: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> In-Reply-To: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762858197; l=959; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=xj97LjnkpZXwOaVKrKnQFjnvVZvSP4GS9N09KI7Aj8M=; b=OmnufXbuYmp5o3tfhBXSGrlafXB0/gJmN60StxsJ5P++2JW41ILa5gEzsJ5GkQgy0OBGd7iA1 0Daha48GDwvDPFF+Tf9NF3SyCJveqIGViFPjC42ZvCE1Jl6H6vje8aF X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The 32-bit time variants on musl have different names, provide a fallback. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_abi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/s= elftests/vDSO/vdso_test_abi.c index bb5a5534ae7e8a46d7e68a561684c29a752b866d..0a6b16a21369642384d43b0efd1= bca227a2a4298 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -166,7 +166,11 @@ static void vdso_test_clock_getres(__kernel_clockid_t = clk_id) clock_getres_fail++; } =20 +#ifdef SYS_clock_getres ret =3D syscall(SYS_clock_getres, clk_id, &sys_ts); +#else + ret =3D syscall(SYS_clock_getres_time32, clk_id, &sys_ts); +#endif =20 ksft_print_msg("The syscall resolution is %lld %lld\n", (long long)sys_ts.tv_sec, (long long)sys_ts.tv_nsec); --=20 2.51.0 From nobody Sun Feb 8 19:43:31 2026 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 7A495354AC5; Tue, 11 Nov 2025 10:50:04 +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=1762858206; cv=none; b=rQEcE8jfzIsv7S3IkZfDgIB8DoteE334Mhv111pKDllxDaMaeTxA45TSjLAVl4RfEs+d3V2bNNR/CkPNEBiFC1MIRdFUMlXEU0TFJS/EoPI6bRrLUs6iwflCj6vZNCjhWBekK8VINZR7e7NdcImflBc7TsP/Z5Tno6EQsFAhhK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762858206; c=relaxed/simple; bh=IhZCZpYTEfcsIhUb1OvA+o2aZg+IqFDuCoJX9+mQwCg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KfVhYLet0puU5F+3Viv2efRljKkCYR7PI2KzBwxNFC14DYVKj10OsnDGI+DVm1PoB1JQDL4JGtlqgmsL49kA67KD+alCjiPSxMaAGzgYteWmxwHgcfdo/Zfj5G70oq4bMtHc26xSf2pBDzkC3/4O19LtcrdR9CFKQkptItEsvH8= 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=WfU01Wzm; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=T348zkGA; 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="WfU01Wzm"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="T348zkGA" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762858201; h=from:from: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=0mBr7wG1x9Eu1Fb7Qvx7iJnYkPB3hiuiZVSG49/GyNg=; b=WfU01Wzmk8dpo431BaDYCaTV1EL3VOGQ76evwKijVL/Upb49txCvNceaDhRs/gW7re9y87 ArKwOgfEXdhZ9zS2hQ8C3G0W6lC8FGtEkPrNU+Kay1dNvn+mvFTVHowg0sKEOqbWYEeAdL YXHa9hpuM1o4BI1G0gxQWqA4ilvx+/lNyjRw54ZI7m6L/ygRxSYIKN4a+/SueMyKHSiCJH WdyDyIZ7/y0l9QffCW3YwUCr4YHpoNc1LrpGaQ2cwaBiiBCz4Cf27KJ/h1tmaNwjl/STZf ps40MmB2AbRhRTf7hVhYgMzMImkyeviLy5SGhIoA7LXrqpq3hIBzDkWNX7hgKg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762858201; h=from:from: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=0mBr7wG1x9Eu1Fb7Qvx7iJnYkPB3hiuiZVSG49/GyNg=; b=T348zkGAlrXxJl/WRR54xuuvZzhy3V7QS+SiMtWKcO7s5n/o3rB/r2wn8lLebG/ethhC5j sotsISteaPedYlDg== Date: Tue, 11 Nov 2025 11:49:51 +0100 Subject: [PATCH 05/10] selftests: vDSO: vdso_test_gettimeofday: Remove nolibc checks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251111-vdso-test-types-v1-5-03b31f88c659@linutronix.de> References: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> In-Reply-To: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762858197; l=778; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=IhZCZpYTEfcsIhUb1OvA+o2aZg+IqFDuCoJX9+mQwCg=; b=4a0qkz1c329rNTLWsQJt4rnjWgS+Gn5XRo9JZJ7wynRAbBnzpBwPXeKIapVeDZQtoCQQhQGDr UffzOJH3JzpAd0aluOcQEmNzaS7xzTorDbXe6rtzYw8lBdD8LGpgRln X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= nolibc now provides these headers, making the check unnecessary. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c b/tools/= testing/selftests/vDSO/vdso_test_gettimeofday.c index 9ce795b806f0992b83cef78c7e16fac0e54750da..636a56ccf8e4e7943ca446fe3fa= d6897598ca77f 100644 --- a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c +++ b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c @@ -11,10 +11,8 @@ */ =20 #include -#ifndef NOLIBC #include #include -#endif =20 #include "../kselftest.h" #include "parse_vdso.h" --=20 2.51.0 From nobody Sun Feb 8 19:43:31 2026 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 7A5A8354AC6; Tue, 11 Nov 2025 10:50:04 +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=1762858207; cv=none; b=kKWVET/qnnuVuuYQXuPvUvRAc2yrv9I2MkdVObCpX0o4ePDPWoT5jPSBQ4dldJ/Uranplo58XrJUMjvOZmNJn7vs+lh1Qy9Sz/k+y3L2+CjuwCFjOuad9kEIwHtJ6R1oWo4kmBCjf+9bpYu5MSoGyTG0Wi9mpGgtsFft7cvJgXA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762858207; c=relaxed/simple; bh=aE/WV2Mi+bsanJlDrSl9gQQohVGvHhC6JpfJzLKQvZ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D8lxe6FuFYukU6lkybqWyrmHNZI38FHFBLGtpfp5kBpiUfEdr3AJ1nVVQ/F2hpEoxpgK21I46ksLkJjF67NRylpInWX+bzAu1bfHGa/ZqHiaosKHU5eYYDaLon3g7ZASe8Z8ZLY/q8P8Iy5zXZwD++GWhtYk+ReAuubhc/LK4OU= 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=i9lolI1B; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=EyvosTSU; 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="i9lolI1B"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="EyvosTSU" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762858201; h=from:from: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=EWRbOr5K7jIjvQLAayug9MX0ujPyaf2nA2ZDGHxUXu0=; b=i9lolI1Bn0RSekhyqAdOd2QEQyuNQfRpiFVauBncJw/j0UhgkHldW7kecGbfcSlXNA/yQ8 MP36fXmxQNxG10xV2HC32sqKCHX49hdTiga8pEKCuctlnV6kC+jh5VZZ08dMXuDVjoNQfr ktOUq1xg7Iu7O2m32BOvXMiUibO17G7mLy9UlC7ouUXG7TugAgQFUnR/NJAEsdhn5If7lm N5IUIQvL/O6M4MypTLRem110CF7Qu1sTh/DX4ZiKWqjbOVdC3NQJdSMuWhZv8iyk89BN4G aSOVLTogPT6Vw6K+C2CGJgg2FXcd20bfC0imGuYM8BSClN7tGDw2ozutnCQxgw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762858201; h=from:from: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=EWRbOr5K7jIjvQLAayug9MX0ujPyaf2nA2ZDGHxUXu0=; b=EyvosTSUNObO3aUsVv4sVFnmRzSLwrQyEIaGWw1wR9zXbZk9g5nXcBp4wDgx1bd+Ml7GqO FsL2Z9MOKz1Sr9BQ== Date: Tue, 11 Nov 2025 11:49:52 +0100 Subject: [PATCH 06/10] selftests: vDSO: vdso_test_gettimeofday: Use types from vdso_types.h Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251111-vdso-test-types-v1-6-03b31f88c659@linutronix.de> References: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> In-Reply-To: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762858197; l=1506; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=aE/WV2Mi+bsanJlDrSl9gQQohVGvHhC6JpfJzLKQvZ4=; b=tEkNcq7+NZy5sFxOA6RFDjM0t4pvowlJ6pVzOV7q9hXnHptafetJy5+rd7wfBsgZgBtgge72w FkfLVCp+K69AIh2VSwEu4oThylG8zjMfei8tYMpgKkbkRP38scbMXLF X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The libc types are not necessarily compatible with the vDSO functions. Use the dedicated types from vdso_types.h instead. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_gettimeofday.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c b/tools/= testing/selftests/vDSO/vdso_test_gettimeofday.c index 636a56ccf8e4e7943ca446fe3fad6897598ca77f..3c14ed654428e0dbe08e9d44671= e82737ac61486 100644 --- a/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c +++ b/tools/testing/selftests/vDSO/vdso_test_gettimeofday.c @@ -12,12 +12,12 @@ =20 #include #include -#include =20 #include "../kselftest.h" #include "parse_vdso.h" #include "vdso_config.h" #include "vdso_call.h" +#include "vdso_types.h" =20 int main(int argc, char **argv) { @@ -33,15 +33,14 @@ int main(int argc, char **argv) vdso_init_from_sysinfo_ehdr(getauxval(AT_SYSINFO_EHDR)); =20 /* Find gettimeofday. */ - typedef long (*gtod_t)(struct timeval *tv, struct timezone *tz); - gtod_t gtod =3D (gtod_t)vdso_sym(version, name[0]); + vdso_gettimeofday_t gtod =3D (vdso_gettimeofday_t)vdso_sym(version, name[= 0]); =20 if (!gtod) { printf("Could not find %s\n", name[0]); return KSFT_SKIP; } =20 - struct timeval tv; + struct __kernel_old_timeval tv; long ret =3D VDSO_CALL(gtod, 2, &tv, 0); =20 if (ret =3D=3D 0) { --=20 2.51.0 From nobody Sun Feb 8 19:43:31 2026 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 7AC91354ACB; Tue, 11 Nov 2025 10:50:04 +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=1762858206; cv=none; b=oXLNEJCTkMLNmuMUEjAGVJ1Fv8XnIaZI8v7zqZid/yMgXH1cEodTXzwo0MFnDnracG4GLJLYa45QZZztCiDhR01CaWMX5S/kJieijnjyfmRUwY2uUisMJTxcGIscmrqeywZnlGZa4Ytu5I7K9cigcnIP1+7TiVMm6Afs+sBVJqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762858206; c=relaxed/simple; bh=mgBbhqKXIVtDgBpWnLQNQGMfOsIij1eGHRln0s0hly4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bjMmvr4z29tHx0i++nyU3G/RDGpy00X2a2JG9BNUh6rFkC/L6LW7KtN+w+qftb4bprDLKgNbA1ntT083GfcazLkmuSBSvkPUOMSoKBQAFEjePNFLmdaOI1oqg+Lv3uoidFbbRPiq1dPTtpBfNrvjhbZ3w3bK+iw2m8IbGNR6amw= 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=kX62CJfs; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=vdkja6jT; 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="kX62CJfs"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="vdkja6jT" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762858202; h=from:from: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=sistUqI+ZNMZcEsNWeX14s6eyv+7oxVPQusG72kG8mg=; b=kX62CJfsu34b/p1ELlKrVuaLCRDsqj0cf/1o9ndnkd4WUERKUdUwjC9YEiJePnTq01MaS8 jYjuRW34m638jv9FGL1diWmcgES4mJ9LE2ez2QCq4YL+YXH9ahMSS/jxi588lyb+C2dHY1 gbUjpqzLXoogfH1WiS4TFoZLqyE6kC23nWemczjEfLWu6tF2QpLkercb4Is/WGsp5wcvzP Bqkk5GrhDBLtWZz01JX/gTcszoSDf7JvQOLqU/kW0ygidqJAUCODq17hdoof2Yx/oiXbGu fkFF3q0K82L23crkHgnGPfYx8vzWCcOIITkjX3zBtlfo6XyNPLabpA/CGcfdnQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762858202; h=from:from: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=sistUqI+ZNMZcEsNWeX14s6eyv+7oxVPQusG72kG8mg=; b=vdkja6jTT93WzFXfEgOaffywrrBGK9186pEZyLOwk24KsUjVuKPPGglUH66EmOUjp4skVw 42/EC200V9LuN0Dw== Date: Tue, 11 Nov 2025 11:49:53 +0100 Subject: [PATCH 07/10] selftests: vDSO: vdso_test_correctness: Drop SYS_getcpu fallbacks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251111-vdso-test-types-v1-7-03b31f88c659@linutronix.de> References: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> In-Reply-To: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762858197; l=858; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=mgBbhqKXIVtDgBpWnLQNQGMfOsIij1eGHRln0s0hly4=; b=+mz60Gl3j8aCAxam+h0y27sD2AoYMmH2/BdXJEx63i/d4+4aTD+zsi4iUfoO5vZKqueBFaeN6 iijz2PaVHSJD+YlmkH2GRBR8oWQnBJ4IS2qiM7alGDGwsKeDMaKKr9o X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= These fallbacks are only valid on x86 and unused in the first place. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_correctness.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/t= esting/selftests/vDSO/vdso_test_correctness.c index da651cf53c6ca4242085de109c7fc57bd807297c..66cd1d4c19872e78c0e608f5e0f= b5215cf902b50 100644 --- a/tools/testing/selftests/vDSO/vdso_test_correctness.c +++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c @@ -25,14 +25,6 @@ =20 static const char **name; =20 -#ifndef SYS_getcpu -# ifdef __x86_64__ -# define SYS_getcpu 309 -# else -# define SYS_getcpu 318 -# endif -#endif - #ifndef __NR_clock_gettime64 #define __NR_clock_gettime64 403 #endif --=20 2.51.0 From nobody Sun Feb 8 19:43:31 2026 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 DF5452F5A11; Tue, 11 Nov 2025 10:50:04 +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=1762858207; cv=none; b=cLkdbLd+l5mXLXpv1RUy/Gf9T9dWkCYSUQO8Mc3TPzlFxh0RFeGJNAgcrku292kiGZwAMSoFgIYEmuUWJSl/uDvprG+A1Oc7rOKXOwzrpAlmojqQc8e1+G8FAEn2omHtbJcHy2zVMlortyMWyPa43/P0ZJnY9c6adNlBtVfElSA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762858207; c=relaxed/simple; bh=Oro3PElE1z2+SwLbrs9IOy1Jl54HgbslXfaifTttu+w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qog37O/BklcQ8Jk74/GYcJ39QN2jMT3Qpe+Ke9aogboqkVmbyoFx7r5J1K39oNe8g1ewkRUv59HrTGF4wX/MlhPi0RAGoy4gUFMncscNLdUfi1tB2KLIRq65gBXHVcHCeeCdjTMuTmBmbsiVohiOwXqmz9y1Xur2/MgoDTqlD2c= 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=yCds3eaT; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=VnBd3g6s; 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="yCds3eaT"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="VnBd3g6s" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762858202; h=from:from: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=gLMf3I4wnol8bvAcGZiyRNvvSI5dCyPel/HOEhBu/kM=; b=yCds3eaTxYu9ZVDZnCM+ccl8eo7YZqZ639SnYK/tLLbWyHm9yWoaU5P+ym8YVaGfDuHBW1 R6abi62I6QA5/5M4TDdxDxMNrJVCA9P1YBHtpLTaOkgttUR9PUwVqRo6oTUg1UFv2Ys9R3 TDng1iaYnPdXJzq0yjPHT20Tq5DsnyfzU/ug9qWZ1N9Rk3PzKTpVTGyBnAdupdF7GYvKFB cHGjGPfFBLofGk8kitue6MDWba99VFJdTdIxjxiI2v5RbZeZvqeoqx/bwBIZl8/qgV1iYk Vscg2wzZcOZK89a+rWAteXVSm4IvpEUOGf8pMnws0VAsr0sVftvj9cOXvNCqVg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762858202; h=from:from: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=gLMf3I4wnol8bvAcGZiyRNvvSI5dCyPel/HOEhBu/kM=; b=VnBd3g6sX7LF2fW413kcjSwmcgiXv3OTysHxJTCWt+3+HfCoLnW/W9mi0bMMA/9O6ixnRR +a24OyIYQrZQFLCA== Date: Tue, 11 Nov 2025 11:49:54 +0100 Subject: [PATCH 08/10] selftests: vDSO: vdso_test_correctness: Use types from vdso_types.h Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251111-vdso-test-types-v1-8-03b31f88c659@linutronix.de> References: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> In-Reply-To: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762858197; l=4811; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Oro3PElE1z2+SwLbrs9IOy1Jl54HgbslXfaifTttu+w=; b=YUPkhREmKAHa9gHF4q/tsAvb6oPs0uFxbOArhSydzE2AFmUK81W+lriuzCTMFteWPOiBgyIiX rgOqgdzziu2AtCb7I9gwtzX/krq3C2/8dp+rG1WUHT2QV888h22EBsG X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The libc types are not necessarily compatible with the vDSO functions. Use the dedicated types from vdso_types.h instead. Signed-off-by: Thomas Wei=C3=9Fschuh --- .../testing/selftests/vDSO/vdso_test_correctness.c | 45 ++++++++----------= ---- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/t= esting/selftests/vDSO/vdso_test_correctness.c index 66cd1d4c19872e78c0e608f5e0fb5215cf902b50..77bd77c32456617fc1ee240aebc= e57cf5b1cf89d 100644 --- a/tools/testing/selftests/vDSO/vdso_test_correctness.c +++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c @@ -7,7 +7,6 @@ #define _GNU_SOURCE =20 #include -#include #include #include #include @@ -21,6 +20,7 @@ =20 #include "vdso_config.h" #include "vdso_call.h" +#include "vdso_types.h" #include "../kselftest.h" =20 static const char **name; @@ -29,29 +29,14 @@ static const char **name; #define __NR_clock_gettime64 403 #endif =20 -#ifndef __kernel_timespec -struct __kernel_timespec { - long long tv_sec; - long long tv_nsec; -}; -#endif - /* max length of lines in /proc/self/maps - anything longer is skipped her= e */ #define MAPS_LINE_LEN 128 =20 int nerrs =3D 0; =20 -typedef int (*vgettime_t)(clockid_t, struct timespec *); - -vgettime_t vdso_clock_gettime; - -typedef int (*vgettime64_t)(clockid_t, struct __kernel_timespec *); - -vgettime64_t vdso_clock_gettime64; - -typedef long (*vgtod_t)(struct timeval *tv, struct timezone *tz); - -vgtod_t vdso_gettimeofday; +vdso_clock_gettime_t vdso_clock_gettime; +vdso_clock_gettime64_t vdso_clock_gettime64; +vdso_gettimeofday_t vdso_gettimeofday; =20 typedef long (*getcpu_t)(unsigned *, unsigned *, void *); =20 @@ -124,17 +109,17 @@ static void fill_function_pointers(void) =20 vgetcpu =3D (getcpu_t) vsyscall_getcpu(); =20 - vdso_clock_gettime =3D (vgettime_t)dlsym(vdso, name[1]); + vdso_clock_gettime =3D (vdso_clock_gettime_t)dlsym(vdso, name[1]); if (!vdso_clock_gettime) printf("Warning: failed to find clock_gettime in vDSO\n"); =20 #if defined(VDSO_32BIT) - vdso_clock_gettime64 =3D (vgettime64_t)dlsym(vdso, name[5]); + vdso_clock_gettime64 =3D (vdso_clock_gettime64_t)dlsym(vdso, name[5]); if (!vdso_clock_gettime64) printf("Warning: failed to find clock_gettime64 in vDSO\n"); #endif =20 - vdso_gettimeofday =3D (vgtod_t)dlsym(vdso, name[0]); + vdso_gettimeofday =3D (vdso_gettimeofday_t)dlsym(vdso, name[0]); if (!vdso_gettimeofday) printf("Warning: failed to find gettimeofday in vDSO\n"); =20 @@ -146,17 +131,17 @@ static long sys_getcpu(unsigned * cpu, unsigned * nod= e, return syscall(__NR_getcpu, cpu, node, cache); } =20 -static inline int sys_clock_gettime(clockid_t id, struct timespec *ts) +static inline int sys_clock_gettime(__kernel_clockid_t id, struct __kernel= _old_timespec *ts) { return syscall(__NR_clock_gettime, id, ts); } =20 -static inline int sys_clock_gettime64(clockid_t id, struct __kernel_timesp= ec *ts) +static inline int sys_clock_gettime64(__kernel_clockid_t id, struct __kern= el_timespec *ts) { return syscall(__NR_clock_gettime64, id, ts); } =20 -static inline int sys_gettimeofday(struct timeval *tv, struct timezone *tz) +static inline int sys_gettimeofday(struct __kernel_old_timeval *tv, struct= kernel_timezone *tz) { return syscall(__NR_gettimeofday, tv, tz); } @@ -213,7 +198,7 @@ static void test_getcpu(void) } } =20 -static bool ts_leq(const struct timespec *a, const struct timespec *b) +static bool ts_leq(const struct __kernel_old_timespec *a, const struct __k= ernel_old_timespec *b) { if (a->tv_sec !=3D b->tv_sec) return a->tv_sec < b->tv_sec; @@ -230,7 +215,7 @@ static bool ts64_leq(const struct __kernel_timespec *a, return a->tv_nsec <=3D b->tv_nsec; } =20 -static bool tv_leq(const struct timeval *a, const struct timeval *b) +static bool tv_leq(const struct __kernel_old_timeval *a, const struct __ke= rnel_old_timeval *b) { if (a->tv_sec !=3D b->tv_sec) return a->tv_sec < b->tv_sec; @@ -255,7 +240,7 @@ static char const * const clocknames[] =3D { =20 static void test_one_clock_gettime(int clock, const char *name) { - struct timespec start, vdso, end; + struct __kernel_old_timespec start, vdso, end; int vdso_ret, end_ret; =20 printf("[RUN]\tTesting clock_gettime for clock %s (%d)...\n", name, clock= ); @@ -379,8 +364,8 @@ static void test_clock_gettime64(void) =20 static void test_gettimeofday(void) { - struct timeval start, vdso, end; - struct timezone sys_tz, vdso_tz; + struct __kernel_old_timeval start, vdso, end; + struct kernel_timezone sys_tz, vdso_tz; int vdso_ret, end_ret; =20 if (!vdso_gettimeofday) --=20 2.51.0 From nobody Sun Feb 8 19:43:31 2026 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 60C7C354AE1; Tue, 11 Nov 2025 10:50:05 +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=1762858207; cv=none; b=g5BCowh6W4i4PKSG9MtOXyYbslSB7fEKy6NhWjJy5aij/ds/G9u47pMYzu25pRguxV7YLGVbxMzBrtcUr6+pXZCG82U/2s4IhTTm26RmmyjWeTQI05/+u6SFj0bdRnd/pYstRJ5dxAU0iKGwxaI770qJYFSK37vdZbCHPMZ/FZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762858207; c=relaxed/simple; bh=eDYIfI87JtASKFq5DZDwOQRcnHRn2lkznxw3yqxmbZk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eZT+xgn3yv5VMVEzTu7LxH9T78UFeUZszo4jHBy2JRpTLJy/hCLWVzaObRHLtBKqj6I6Xr0gNPjy4WINWmd/ynZpzuA3tNFZdmDQLPUM1yrfOi/7SLGWfzCNppgizq2Q5AwepMyGe7ujQTCxlmXHiBZIXNH4M08D7WH5SLY+gpk= 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=nfodT/Ws; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=KBxkZoJA; 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="nfodT/Ws"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KBxkZoJA" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762858203; h=from:from: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=jSfAUOk1ZvIB9pdyoAnLsCO05GQqSiGT56a4QjuGta8=; b=nfodT/Wsb3CPO6RRF4ESRNU3K4f0yIepPn+8c+nCHPvchMITYvn4oNAOotr0Z1/e07GmnL Oy307wJrW20aYpR56NEagbp1sHzVaUzkMS0Wr3PUn/zqVDwM1FJHL7ecbgL7IFDaRxiYXZ 4ayAZQDebItP3i+ZBP/3IVtwaojeSSeEkPS5Jfgqzb45mccihoWl4m1tdV1sy8O1k2KvLG lfCSLLsh3Ck+AclxbzR9YaoB/E9GBl13rhkoLQ7nc3PzWZepTmHFtWg1dn4BpVd+8cLjDG ZOXR8pJqm8MqmeG0Go2Eq1WM+krRTZR9LI9pwXnl8nO32AivMidgSYb3TuHkDQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762858203; h=from:from: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=jSfAUOk1ZvIB9pdyoAnLsCO05GQqSiGT56a4QjuGta8=; b=KBxkZoJAk6ru88kdsZUkDPZZtixPcPLi/aO6ZfWs42YzQjXObIUE0A2XMgtGrwMbTqKC0g R6XCa5Y9d6I5TODw== Date: Tue, 11 Nov 2025 11:49:55 +0100 Subject: [PATCH 09/10] selftests: vDSO: vdso_test_correctness: Provide compatibility with 32-bit musl Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251111-vdso-test-types-v1-9-03b31f88c659@linutronix.de> References: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> In-Reply-To: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762858197; l=1419; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=eDYIfI87JtASKFq5DZDwOQRcnHRn2lkznxw3yqxmbZk=; b=IcCRhHV57188lxxjMd2rGBSFLt/GGQSGuNU9TF29c1zxSy1cQEEhdYBPs1egggYdCQXnjr6SN KT7cV9iGDC1BsAncPXBdJ0k4K8PekJavoCV8p57niq5IrRBLHTDc2j7 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The 32-bit time variants on musl have different names, provide fallbacks. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_correctness.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/t= esting/selftests/vDSO/vdso_test_correctness.c index 77bd77c32456617fc1ee240aebce57cf5b1cf89d..b27c28cd00a2b974751dffae850= f34517ada094d 100644 --- a/tools/testing/selftests/vDSO/vdso_test_correctness.c +++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c @@ -133,7 +133,11 @@ static long sys_getcpu(unsigned * cpu, unsigned * node, =20 static inline int sys_clock_gettime(__kernel_clockid_t id, struct __kernel= _old_timespec *ts) { +#ifdef __NR_clock_gettime return syscall(__NR_clock_gettime, id, ts); +#else + return syscall(__NR_clock_gettime32, id, ts); +#endif } =20 static inline int sys_clock_gettime64(__kernel_clockid_t id, struct __kern= el_timespec *ts) @@ -143,7 +147,11 @@ static inline int sys_clock_gettime64(__kernel_clockid= _t id, struct __kernel_tim =20 static inline int sys_gettimeofday(struct __kernel_old_timeval *tv, struct= kernel_timezone *tz) { +#ifdef __NR_gettimeofday return syscall(__NR_gettimeofday, tv, tz); +#else + return syscall(__NR_gettimeofday_time32, tv, tz); +#endif } =20 static void test_getcpu(void) --=20 2.51.0 From nobody Sun Feb 8 19:43:31 2026 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 A91F5354AEE; Tue, 11 Nov 2025 10:50:05 +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=1762858208; cv=none; b=dwPj1/YkTVdi81k9h9UYiUbTfNED1YTlDOzgSoztp19+2eytK5+JhkjOGtVALRWsCpfD6Uft+/BtWHuvyD6wmZxTO33mnEzkrKhIx72nGIKMpPZRxKlfXGCAJJmd2B/wY/dvgAQsXXNe0k9LONLj+xsA+HreQGMpf2R/pAvE9fw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762858208; c=relaxed/simple; bh=EWQJQ6D5JmJ0c/Pv8shy9wjpsGBrg9Cm+Eo4OM5oVz8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ECO/muzsvcB/QgR5CCWogw+Ad4Va0b8iWVAz1NsAVHc4uYU56IscLd6S2N+ruWwgGTumNi867dLtjZ7Sk0au3KpBbcr60dQrBiPqDmlIno47JdEL+tSyRmgNHUqY2SSiD4hJHxVtuh/Mm/XgWe70H76zi1kxB4W3JmTCN4bzJ9w= 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=LgBxe6yC; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=DWi326Wa; 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="LgBxe6yC"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DWi326Wa" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1762858204; h=from:from: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=0Wf3tKTzsmVv2SCafM8ESNg4uW5j8HNf/0LInI7K5hc=; b=LgBxe6yCfLAEF5LSihvW/M5EBwoRmVADNCynZcsc/aLbhld6MLEcFQ7RaLKIJeKNFsMVlv i20oQ0fkag4gzEaXfTtsJhgOmefrb2Uas5TpjfkTNlWJn424KKA2EQ0gIRC32PRwZraCMw GAS9fLnloBgBa/3o0l2GGj9e3rI7cZ7Csn2sNWOrfwtAtRBRHJQIel1VqtuBE09l0lJ2lG IJbChuakpRxFqpH/SknlEBtgZRtxvdlcEqG9My3fWjxeL+SA9rCUtkA0X/M0iu6alGkND0 4q2IO1WCUy1eyScP3Ieqdfftu3a6b1mRH11pDvpUNIy0dbhE/tB/xdz9Hg/FUA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1762858204; h=from:from: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=0Wf3tKTzsmVv2SCafM8ESNg4uW5j8HNf/0LInI7K5hc=; b=DWi326Wari96UnrgAzh5eP3e1ebJBe0iGmMzJZMlmAUjBdv8ZmWfHotK1HVzEEST8CjYLJ I4rhFxaJAaQb5MCA== Date: Tue, 11 Nov 2025 11:49:56 +0100 Subject: [PATCH 10/10] selftests: vDSO: vdso_test_correctness: Use facilities from parse_vdso.c Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251111-vdso-test-types-v1-10-03b31f88c659@linutronix.de> References: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> In-Reply-To: <20251111-vdso-test-types-v1-0-03b31f88c659@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1762858197; l=4393; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=EWQJQ6D5JmJ0c/Pv8shy9wjpsGBrg9Cm+Eo4OM5oVz8=; b=NyMlxBOo0PMMEcOP2Lmv4zVBVOJuOpCnvzWHrx11IZLIffAKvkFa4mlvB+UaNaLlUJRp4eKxr e2vRIzbuDT0A9L/P4Ln0WsnKd/00uoidVccI79JiEWVmKCFXfG0jO85 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The soname from the vDSO is not a public API. Furthermore it requires libc to implement dlsym() and friends. Use the facilities from parse_vdso.c instead which uses the official vDSO ABI to find it, aligned with the other vDSO selftests. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/Makefile | 4 +-- .../testing/selftests/vDSO/vdso_test_correctness.c | 30 ++++++++++--------= ---- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftest= s/vDSO/Makefile index 2de5cef311c8ab695606cf7f408c04910842e377..a61047bdcd576d47d944f442f9e= 7140fccfe58e0 100644 --- a/tools/testing/selftests/vDSO/Makefile +++ b/tools/testing/selftests/vDSO/Makefile @@ -26,13 +26,11 @@ CFLAGS_NOLIBC :=3D -nostdlib -nostdinc -ffreestanding -= fno-asynchronous-unwind-tab $(OUTPUT)/vdso_test_gettimeofday: parse_vdso.c vdso_test_gettimeofday.c $(OUTPUT)/vdso_test_getcpu: parse_vdso.c vdso_test_getcpu.c $(OUTPUT)/vdso_test_abi: parse_vdso.c vdso_test_abi.c +$(OUTPUT)/vdso_test_correctness: parse_vdso.c vdso_test_correctness.c =20 $(OUTPUT)/vdso_standalone_test_x86: vdso_standalone_test_x86.c parse_vdso.= c | headers $(OUTPUT)/vdso_standalone_test_x86: CFLAGS:=3D$(CFLAGS_NOLIBC) $(CFLAGS) =20 -$(OUTPUT)/vdso_test_correctness: vdso_test_correctness.c -$(OUTPUT)/vdso_test_correctness: LDFLAGS +=3D -ldl - $(OUTPUT)/vdso_test_getrandom: parse_vdso.c $(OUTPUT)/vdso_test_getrandom: CFLAGS +=3D -isystem $(top_srcdir)/tools/in= clude \ $(KHDR_INCLUDES) \ diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/t= esting/selftests/vDSO/vdso_test_correctness.c index b27c28cd00a2b974751dffae850f34517ada094d..bda090b8f74632325ba0f15898d= bc45656a73090 100644 --- a/tools/testing/selftests/vDSO/vdso_test_correctness.c +++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c @@ -10,19 +10,21 @@ #include #include #include +#include #include -#include #include #include #include #include #include =20 +#include "parse_vdso.h" #include "vdso_config.h" #include "vdso_call.h" #include "vdso_types.h" #include "../kselftest.h" =20 +static const char *version; static const char **name; =20 #ifndef __NR_clock_gettime64 @@ -87,39 +89,32 @@ static void *vsyscall_getcpu(void) =20 static void fill_function_pointers(void) { - void *vdso =3D dlopen("linux-vdso.so.1", - RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); - if (!vdso) - vdso =3D dlopen("linux-gate.so.1", - RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); - if (!vdso) - vdso =3D dlopen("linux-vdso32.so.1", - RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); - if (!vdso) - vdso =3D dlopen("linux-vdso64.so.1", - RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); - if (!vdso) { + unsigned long sysinfo_ehdr =3D getauxval(AT_SYSINFO_EHDR); + + if (!sysinfo_ehdr) { printf("[WARN]\tfailed to find vDSO\n"); return; } =20 - vdso_getcpu =3D (getcpu_t)dlsym(vdso, name[4]); + vdso_init_from_sysinfo_ehdr(sysinfo_ehdr); + + vdso_getcpu =3D (getcpu_t)vdso_sym(version, name[4]); if (!vdso_getcpu) printf("Warning: failed to find getcpu in vDSO\n"); =20 vgetcpu =3D (getcpu_t) vsyscall_getcpu(); =20 - vdso_clock_gettime =3D (vdso_clock_gettime_t)dlsym(vdso, name[1]); + vdso_clock_gettime =3D (vdso_clock_gettime_t)vdso_sym(version, name[1]); if (!vdso_clock_gettime) printf("Warning: failed to find clock_gettime in vDSO\n"); =20 #if defined(VDSO_32BIT) - vdso_clock_gettime64 =3D (vdso_clock_gettime64_t)dlsym(vdso, name[5]); + vdso_clock_gettime64 =3D (vdso_clock_gettime64_t)vdso_sym(version, name[5= ]); if (!vdso_clock_gettime64) printf("Warning: failed to find clock_gettime64 in vDSO\n"); #endif =20 - vdso_gettimeofday =3D (vdso_gettimeofday_t)dlsym(vdso, name[0]); + vdso_gettimeofday =3D (vdso_gettimeofday_t)vdso_sym(version, name[0]); if (!vdso_gettimeofday) printf("Warning: failed to find gettimeofday in vDSO\n"); =20 @@ -422,6 +417,7 @@ static void test_gettimeofday(void) =20 int main(int argc, char **argv) { + version =3D versions[VDSO_VERSION]; name =3D (const char **)&names[VDSO_NAMES]; =20 fill_function_pointers(); --=20 2.51.0