From nobody Mon Feb 9 16:34:13 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 4784A334C27; Thu, 15 Jan 2026 08:30:08 +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=1768465813; cv=none; b=GJAtu/oDIMizkCKtHdirIIyeJaIJBC28OjPxgm2URvHrciAwZT1vD6SPBKqYloRQqBNurGpGs/jAimVnPTvLBa9AxH8/UYHCGW2UrKK2azP6uX8t6zzUNJnX6ObrJ2UWjPbDGSz8Y8WimHzpmr9AU12UGca88Zw3lQbJLcU7ISs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768465813; c=relaxed/simple; bh=aT4hP/Xjaz7+PkNF5DQWPJA6Sb3o1cAR5eFVQ/RwAdY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F2RsAzT0Y4viyabz9U8c7kUHmkX98fQ4gqT8n5Po1D+Q1x5bXvX0tw5mRsoChiMEMkckkMCYSFVbQONS7ktN80e+FkH8wmYUKtngCo62D1xsyPpsQSpcj0PVPPNWCS6cnVEzMboXqetxJOCIzKTgY27u7ux5MzVuvmfLzn9py6Y= 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=TIPGLfQS; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1fTyM0dN; 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="TIPGLfQS"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1fTyM0dN" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768465800; 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=FIAW7yt+HRVaavrO4/GGIGyhQt+lpXP6LVx2zSI/KXc=; b=TIPGLfQSzSugXhKQw1yssBHRvchWYzGcuaW8ybb+u2jLmm74sgm78+9ftN5DRnHdBBAQGX Jpp1UVu1a1wA3LjIY2L2BX1xLpe6f0qWztL87cE6dSQpoPd5zvhqZ/uL7IcxQteOwtJuzI 27QR1ckjlpJVusFKivOJMUxeK0SPJ6odESqU/cixRNNVWcgJfv4GgLNM5VkRDc+xQKoreB 3w6VukK4o29tDoLAEX4q9yAPk9WH2dHckZ11vSv+MNAXaQA7jgoDIWEMDfXupgG1zWNvze 0EQiPWsyyYrKtx0zZnbqa/ewZ8GEnW/xmS3Pfn6qaIIUeuN9eNV3SmHa44aGKA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768465800; 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=FIAW7yt+HRVaavrO4/GGIGyhQt+lpXP6LVx2zSI/KXc=; b=1fTyM0dNy/EUlGLy7sQnMjBZH2RN0QUXP8zweyJ9e1OkjJI7mEF+qAUyaDrzwY+e+NgU+n kDbissPk5F0iJhBw== Date: Thu, 15 Jan 2026 09:29:53 +0100 Subject: [PATCH 1/6] 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: <20260115-vdso-selftest-cleanups-v1-1-103e1ccbfdc3@linutronix.de> References: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> In-Reply-To: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: 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=1768465799; l=1734; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=aT4hP/Xjaz7+PkNF5DQWPJA6Sb3o1cAR5eFVQ/RwAdY=; b=I1sfybExBJCy65ulQBUldZkCE+AIFZ+APUUjN9OEYTkWzDg9g5zT4tiNtKRpNkqYQe1CyFkzA fuWbHkETWwFCQX/MHnM7vOJHxSbM1X38YWCxTZyCnpjPhuXL/06RSYi 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 e361aca22a74..2de5cef311c8 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 3ff00fb624a4..c6ff4413ea36 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.52.0 From nobody Mon Feb 9 16:34:13 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 4AB20335BBB; Thu, 15 Jan 2026 08:30:08 +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=1768465811; cv=none; b=sSCHLhdKKUozKVujcJnf4LD+X61gtsgEiO9hm5l61ULboUjVYXma2kYUdFxVC/HdStVGRSS5CK/ecR2J+Pif2Syhz3s3Zy62eUqwecHBajiRhI6/OHs10V76w7DJwqz5Wis9KzNfpj/sLEXSAjao3KjFt9hrfWcpiXTMGC0RUGU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768465811; c=relaxed/simple; bh=ZETxfq7n2DPqI0spm6KBNywIJerE0qImcjNxJ2mRPO0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eQZUZWCtm+uIpPM67ZMnCHR+V7SiTj/aTzIB+pLUuDqRM8t4QF6N1wi3GHptjBcH+rKzyuk0bIkdiXGlvYM2LNpl7kwYIThYjKpHnznSiy2L/RsFIq9ErNggE8rljXwZ43IkWbmw26LvmwPNOkKRBI0/oPEW6paA087wipJv4x0= 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=gnHN9FJn; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=PKCvkpui; 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="gnHN9FJn"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PKCvkpui" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768465801; 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=hCYJf6bn90uM7fZf12d3m2XhGe/TVg9oCIF9d52fnDk=; b=gnHN9FJn089Jq7Eo1HeQqDS5NNC2/dkvLRreHgvDF7NxMVF4Sw4mB4GDTg8+FScQZ9DChW LjOZT2PqoDphkVGJOItHhztbhCKJY2CzxkpZx1du3XCMU57iPVLGAKGCQSGTMiZvozFThw KMQ8fomnfy9IN/Vc96OSNHUfwC4gZHksTAqs2KoDnAwKR5IQvD69s/LLpKFJ1wYlHkCRxl j4G7991CEak4wcvpji1V6c0C2jBpUHE9bPCAIdfGmyCIBbYAYW0cMK8tJre7skEIPNBS2t heppGG/cPWGRDrjFBh29JvqTbPGo7hyalhPviosq+vnJWHgnm/PVdmzvyIvlpQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768465801; 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=hCYJf6bn90uM7fZf12d3m2XhGe/TVg9oCIF9d52fnDk=; b=PKCvkpui59OKXdmNQpJ86a42OWXomV5MSPvRcMp+nYJI3QIeJYeRha+yuRoQ3GSf9zleR/ Wn+aYn6CpIMhxXBw== Date: Thu, 15 Jan 2026 09:29:54 +0100 Subject: [PATCH 2/6] 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: <20260115-vdso-selftest-cleanups-v1-2-103e1ccbfdc3@linutronix.de> References: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> In-Reply-To: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: 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=1768465799; l=719; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=ZETxfq7n2DPqI0spm6KBNywIJerE0qImcjNxJ2mRPO0=; b=6+5a2g25nQzm9LJh+bTgBhNHPFZrQ7q7/ccA3URxH2CYaOEG9VXWRbSf+2KOO2yTRxQ6sDSOR 2otp6WwfbzaAeFujXazAXhp978RIA78r0mvMiNEataKoLm0Tx2cuq7W 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 912edadad92c..990b29e0e272 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.52.0 From nobody Mon Feb 9 16:34:13 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 3DC89336ED7; Thu, 15 Jan 2026 08:30:09 +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=1768465813; cv=none; b=bmeh62jBVrybY4DzOrjPVCOkOW2pC7Ocx1W6GSvDscljYBfNFa6QzaroPO44B11IZY1Nfp7eeKDwut+zBJXU9uBfltyxF7azz9aJ1ccyxxc8m2nJnlkZfICecOd1oVq/4GcEHODCXPhNCCVLsNPczB8qE6Owy2f5Fk12qpUyTB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768465813; c=relaxed/simple; bh=ydZwWGcoYx1I3AmdibzMaVjYIyahHTfLDsQU637jyTY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BX94oaPD3rRzDT6vFFDrckvB2mRWWvaYCqkeOj6WaQG6sUq0sn4Ku72xPLSIBnk7zN5x+xKjxF5qS4D/aUM11nnfr5QOo0SyWs2urQjNTcRIsviBkhbz1CBtlX8JcBwXuxHWn5Isj4gqWNa49fSI16QM1GblUKLYeuLQ6GNl05c= 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=3+7FgoYD; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Ohre5fCq; 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="3+7FgoYD"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Ohre5fCq" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768465801; 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=NG/+/K5ElBiBPbHqDiKqINE0JfCV/poKOET6u3GJLGY=; b=3+7FgoYDoK8IZtazIIpDTD6oIKABFnhQrEqTQl4Rbt2hHPPwLLg62ghWgnhgBAtgfYC6mQ +bdH12chCNzRTCk6VobCTOfbtTnjk5qfSp3vuwFc7XnnwoeObNg1agf0Szpu2XLpXXTO6J J+9SYb94xhLXrUeYw1yDfvM+buYNpX3xNXjNKb9B1/QbglEUWAFnlwG1NeJIP7s1GYOxN5 cl5n/MZ0AaYHZYHkWQsT3URUQCXWKC1N5+DIpNMTR+F+S5EDruvyYLLGN38oy8iMiPTfqU 4spxMr50mEyEO+UFyXzmLH3dn0RklGGgwSh4l9NwZ9bNdxVD3Xr/HrphsuOmOQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768465801; 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=NG/+/K5ElBiBPbHqDiKqINE0JfCV/poKOET6u3GJLGY=; b=Ohre5fCqbUw+lNtoRXhOJWQmOhVbU3QiVIq0PEDtac8akiHN0sU4w0QqT2HFauoYUJcJYU Fun14O4ci0e1izDQ== Date: Thu, 15 Jan 2026 09:29:55 +0100 Subject: [PATCH 3/6] 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: <20260115-vdso-selftest-cleanups-v1-3-103e1ccbfdc3@linutronix.de> References: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> In-Reply-To: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: 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=1768465799; l=802; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=ydZwWGcoYx1I3AmdibzMaVjYIyahHTfLDsQU637jyTY=; b=+V8hPy98B/twqJ4t1Qm2ZMhHVmfg8GVKNGy6o1A8UvmFguEklwL8Y/cak1xfZiYznbHusLXX1 1e5asNCdbBTCLdMeXV7WmkNzngS06VM2EBoN0qqh0dXfG22EH9mb1ic 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 055af95aa552..2a2d9b01a938 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.52.0 From nobody Mon Feb 9 16:34:13 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 6280B3376AC; Thu, 15 Jan 2026 08:30:10 +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=1768465814; cv=none; b=S6Dn5hA/dbnDK+ntPPylL/UpZMECgASLS5R7tw4IcWAuDc4EozCCaPAXLlVYEx1Ixvb+me9nEQ6ehoXF6BTsG8bzw2EaZsMU2JU6LZF9yHwd8F4k7Rh1sV0bElZA3VypTX9iCRdzscmHelqFNGViNMYD8uXD6qwTDKIk9jfE90Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768465814; c=relaxed/simple; bh=d5u4jVkOe54xPXSa2SGMxn+ig8mxSln3f2hshXkA/u8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QczhS/15BysizDk7RyB+i/maey41ubFPZ/h6zg02RHluN8hBRjA2PRK6Pp5e/+YiaWkRIEo4ofbsuWaGUmUFEVePXxC9MhIGjUBMlhvwUn17i9qxHJ8ZnJCDpDM7cbnwF2OU+9GlURAT1hR98VR7kL8Zl8UWf0wuKMuAjx2B738= 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=1M6XrE2q; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=gftZgSNC; 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="1M6XrE2q"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gftZgSNC" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768465802; 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=q2ElU1OUk7NhzldoS3gWwQ6sGhWNatcq3kzNXwmpiAA=; b=1M6XrE2qw80s6vFsTdo2TF6G8rD+0Skcg29W3fy1ACCP3qN6WW2UvGB2Yad4+vSM5sWXa5 4V+ZaQpk9SA/AB4LS9gO0SE1LqS0Hvt8jprtsc0noytDXswsa0bwVAzlW6jYz/2/ygtU4m fqzR+GwNGUJuTLBOOVQy2PnL7gIaaR7hSjK6WiFOkMaYg2gKJAMuaZ4EpR4TAwOq8uYwqz KKBDQ56bycvqI4IoLHbvv3ed01ND8RTvMf1YOmu1ohOkgrVWVBIiDK5PeVIxkhnxLIx0/j Y4ViMAElO6qQ18QjWbAbYXIjz0er5gElkG3sjHBgA0yLKuxNcjS5trkvU4gnOQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768465802; 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=q2ElU1OUk7NhzldoS3gWwQ6sGhWNatcq3kzNXwmpiAA=; b=gftZgSNC7Uoq7gXqG8uHVLCETJzGi6EliiesI9OsvkCYqVAGq6N7BKYugTau+CfY0GgzxG KH5wfc6MFaXrLMCA== Date: Thu, 15 Jan 2026 09:29:56 +0100 Subject: [PATCH 4/6] selftests: vDSO: vdso_test_correctness: Handle different tv_usec types 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: <20260115-vdso-selftest-cleanups-v1-4-103e1ccbfdc3@linutronix.de> References: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> In-Reply-To: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , Andreas Larsson X-Developer-Signature: v=1; a=ed25519-sha256; t=1768465799; l=1580; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=d5u4jVkOe54xPXSa2SGMxn+ig8mxSln3f2hshXkA/u8=; b=/74q3qt/tipah4q+SlHvAMoqWj2HXC1stblxmbwHYZlYZpVmZs6jCCN+8AD7lffTxpp2scEiN 9nmZziTG/4UAzP2/9m6Vw24sKxn3pv2jtCvU9WdhJRMT67FKc47rx3u X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= On SPARC the field tv_usec of 'struct timespec' is not a 'long int', but only a regular int. In this case the format string is incorrect and will trigger compiler warnings. Avoid the warnings by casting to 'long long', similar to how it is done for the tv_sec and what the other similar selftests are doing. Signed-off-by: Thomas Wei=C3=9Fschuh Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson --- tools/testing/selftests/vDSO/vdso_test_correctness.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/t= esting/selftests/vDSO/vdso_test_correctness.c index 2a2d9b01a938..9b564888e74d 100644 --- a/tools/testing/selftests/vDSO/vdso_test_correctness.c +++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c @@ -404,10 +404,10 @@ static void test_gettimeofday(void) return; } =20 - printf("\t%llu.%06ld %llu.%06ld %llu.%06ld\n", - (unsigned long long)start.tv_sec, start.tv_usec, - (unsigned long long)vdso.tv_sec, vdso.tv_usec, - (unsigned long long)end.tv_sec, end.tv_usec); + printf("\t%llu.%06lld %llu.%06lld %llu.%06lld\n", + (unsigned long long)start.tv_sec, (long long)start.tv_usec, + (unsigned long long)vdso.tv_sec, (long long)vdso.tv_usec, + (unsigned long long)end.tv_sec, (long long)end.tv_usec); =20 if (!tv_leq(&start, &vdso) || !tv_leq(&vdso, &end)) { printf("[FAIL]\tTimes are out of sequence\n"); --=20 2.52.0 From nobody Mon Feb 9 16:34:13 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 841D83385BE; Thu, 15 Jan 2026 08:30:14 +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=1768465818; cv=none; b=UpvZSjhJx/sKW1l457B184MjcC+lHUlySaArFvD5p2vClSP7iec5Nh2NKQJpBW2xb9v4scF5xMlhMEgyddYeMj699qUDyXhrW+pylbslpbtPDPcDYfxizc+DCB6GUuwL+URN/L/43DP8saOCJS2XC18eG71eOcDlICULfvi7rhs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768465818; c=relaxed/simple; bh=AER4fGi0z+KKvpkEQeIEQIFzt+vVP2SRhEq8AMYffes=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PyDrndyzjE5b0VhvZnBA4wZcOYkYPBPbIehPty9TSOmvpS9BY/aYq4PMcw44pvTbN56KE0W0oUUaG183fltHi5tvsS8asqFX3O8tbzD9G0fa+qx1POq+ShBESBt3NtKUTpffqDPpKBwyjtD841JAf3admrXfhuB9tbmAmmGS9d4= 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=cGOq1rq1; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=i9G9/5j1; 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="cGOq1rq1"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="i9G9/5j1" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768465802; 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=Ua/mSNRnV7lHdf3pKqR1IcGHRDXxLTzSpocRza2tj2Q=; b=cGOq1rq1s7Jm9vnEoQodFFXodJNOz0PfIgRePJvsuHTFFK6deLmTxNUy/UnnzL5BR91hIi 41ruo6QtMeuC47urIrhYoFukTPIWlxL2uBZGqsUB1BvLfuKUwQ+E09M9j79DP/WPINW6sn Sqzw+h6XcN2fff6vbgP0iB/kZREc0TdyOLDYFflBkAE9ntAZT1bB7JkBznDgEyX1kOCxcF CQppVxIonUq+/Ek8XK6+c59SiWz78R4feF5GZq9I5mu9r4uO0GSiV036UzDOFilT8V82lN PkGiIrRAbw4NOCPcR+5L3MRYIv4RkBj34RGX6mk/DYAfrb+x556zlC/wjgenfw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768465802; 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=Ua/mSNRnV7lHdf3pKqR1IcGHRDXxLTzSpocRza2tj2Q=; b=i9G9/5j1N3pwlH9SXkxmss8AljardXnKazXxZPQ9bq2HHv2vLguUCOwRySBUwYwTOLsgAL ZkOf5soDI8s60qDg== Date: Thu, 15 Jan 2026 09:29:57 +0100 Subject: [PATCH 5/6] 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: <20260115-vdso-selftest-cleanups-v1-5-103e1ccbfdc3@linutronix.de> References: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> In-Reply-To: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: 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=1768465799; l=4190; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=AER4fGi0z+KKvpkEQeIEQIFzt+vVP2SRhEq8AMYffes=; b=9yDNDYIY4OkaIeFrVnaFiSgGPXV5n8XjEJRdG/IhYcLhE5NVh2mNM0GGK/lWNFhCFtxmWLhE8 GV2nfqdXr8NB6KwV2g4225RSWoTfzi/jFqRaO/yG+NcdQy57VSgr+eq 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 2de5cef311c8..a61047bdcd57 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 9b564888e74d..a94ab4d597b1 100644 --- a/tools/testing/selftests/vDSO/vdso_test_correctness.c +++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c @@ -11,18 +11,20 @@ #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 "kselftest.h" =20 +static const char *version; static const char **name; =20 #ifndef __NR_clock_gettime64 @@ -102,39 +104,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 (vgettime_t)dlsym(vdso, name[1]); + vdso_clock_gettime =3D (vgettime_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 (vgettime64_t)dlsym(vdso, name[5]); + vdso_clock_gettime64 =3D (vgettime64_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 (vgtod_t)dlsym(vdso, name[0]); + vdso_gettimeofday =3D (vgtod_t)vdso_sym(version, name[0]); if (!vdso_gettimeofday) printf("Warning: failed to find gettimeofday in vDSO\n"); =20 @@ -429,6 +424,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.52.0 From nobody Mon Feb 9 16:34:13 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 070E333858B; Thu, 15 Jan 2026 08:30:14 +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=1768465818; cv=none; b=cQHb1FVZx1hBs9DJIqPXnWxEF2PMfvsj3kHM2SQhzxgE1xLGbj1uxamfKhYitKMjh6fbxXHv0JD4BBv25ZKQwfHn5aH5xgRpszPd5rtkFgc5nOFZo+lOlh8E0RAXIEaD5DPw74h2uBN70oL2S0+Em0KBSbPLW8OGzQx5NwavT3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768465818; c=relaxed/simple; bh=1vfmJYOF+/h97T7z8tbP5bbEonLwn9Sl6fDSyIbp+3U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NRGt//hBDom7/nFN/pFiUsHvRMhjs4TGvoyyFKzBrtqGaFf63CrQPXcz33FU4s2TZPKeioVMSrgFFtct9bvFvw0+UniYUEX8HwIixwx1zOy6wYgBl0mf+hFVBvIplyRhrar3nDhtlmPRbq/2JR0G3VYEROwGGAcZK2BHv88LsGU= 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=AwL+TqqR; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=d++IX76t; 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="AwL+TqqR"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="d++IX76t" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1768465803; 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=d8vFGubMmHpsAUBxSyQHD6nAoCn+Yk5zsMuHawTiTPY=; b=AwL+TqqRKe4sR2hZ/zGyph8D8WVOW3oYrH4AV0sKbg7C0yUfG4gExrBrIcDMuLteFcM20a cbQOfk7IIieO2xuDVXIVvPDMkXMqKPtnS7399RnJXMrUWNVCqcU2q1kK3YYqCXnPISSJCX AQHSEbQTJQNpWThw89kpu8GRJJKVqweYCkgPno+Iiq+BA9x3aD/OvmpuH1ecqv7eosUM9Z b+kOkFfHZekVdWNywT7r7pjgunN2j3jJCJapI0RF95gkziWKEr/bB/d8SM6+zagiMYEw5r MDpDjI7mPBLbJjkA+xlSXZ82OGzKxEwc7KJs7eYzpTF9v8BIkJrFt9QhXtUcVw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1768465803; 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=d8vFGubMmHpsAUBxSyQHD6nAoCn+Yk5zsMuHawTiTPY=; b=d++IX76teODmsJKozTj4V4dLNe6mzk1p3xxb0HUP0bjXd7Bf0zI9zxIn8ori247ZBmBYZB piOGeHKX0I0KOlAg== Date: Thu, 15 Jan 2026 09:29:58 +0100 Subject: [PATCH 6/6] selftests: vDSO: vdso_test_correctness: Add a test for time() 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: <20260115-vdso-selftest-cleanups-v1-6-103e1ccbfdc3@linutronix.de> References: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> In-Reply-To: <20260115-vdso-selftest-cleanups-v1-0-103e1ccbfdc3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: 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=1768465799; l=2884; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=1vfmJYOF+/h97T7z8tbP5bbEonLwn9Sl6fDSyIbp+3U=; b=LrIzYiP0ItNrBdNFpvvdrMnMxRllRVnAy0h8Rgbux83h/IjA/JTc0uAIsY/m3n1vrTDdXZmhT v2Xk+WT+UoaBrHmhI4100lguLUnyg6UQz/p1utZ6t2KkFad/GqUpYHt X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Extend the test to also cover the time() function. Signed-off-by: Thomas Wei=C3=9Fschuh --- .../testing/selftests/vDSO/vdso_test_correctness.c | 57 ++++++++++++++++++= ++++ 1 file changed, 57 insertions(+) diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/t= esting/selftests/vDSO/vdso_test_correctness.c index a94ab4d597b1..a3634e4980b5 100644 --- a/tools/testing/selftests/vDSO/vdso_test_correctness.c +++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c @@ -55,6 +55,10 @@ typedef long (*vgtod_t)(struct timeval *tv, struct timez= one *tz); =20 vgtod_t vdso_gettimeofday; =20 +typedef time_t (*vtime_t)(__kernel_time_t *tloc); + +vtime_t vdso_time; + typedef long (*getcpu_t)(unsigned *, unsigned *, void *); =20 getcpu_t vgetcpu; @@ -133,6 +137,10 @@ static void fill_function_pointers(void) if (!vdso_gettimeofday) printf("Warning: failed to find gettimeofday in vDSO\n"); =20 + vdso_time =3D (vtime_t)vdso_sym(version, name[2]); + if (!vdso_time) + printf("Warning: failed to find time in vDSO\n"); + } =20 static long sys_getcpu(unsigned * cpu, unsigned * node, @@ -156,6 +164,11 @@ static inline int sys_gettimeofday(struct timeval *tv,= struct timezone *tz) return syscall(__NR_gettimeofday, tv, tz); } =20 +static inline time_t sys_time(__kernel_time_t *tloc) +{ + return syscall(__NR_time, tloc); +} + static void test_getcpu(void) { printf("[RUN]\tTesting getcpu...\n"); @@ -422,6 +435,49 @@ static void test_gettimeofday(void) VDSO_CALL(vdso_gettimeofday, 2, &vdso, NULL); } =20 +static void test_time(void) +{ + __kernel_old_time_t start, end, vdso_ret, vdso_param; + + if (!vdso_time) + return; + + printf("[RUN]\tTesting time...\n"); + + if (sys_time(&start) < 0) { + printf("[FAIL]\tsys_time failed (%d)\n", errno); + nerrs++; + return; + } + + vdso_ret =3D VDSO_CALL(vdso_time, 1, &vdso_param); + end =3D sys_time(NULL); + + if (vdso_ret < 0 || end < 0) { + printf("[FAIL]\tvDSO returned %d, syscall errno=3D%d\n", + (int)vdso_ret, errno); + nerrs++; + return; + } + + printf("\t%lld %lld %lld\n", + (long long)start, + (long long)vdso_ret, + (long long)end); + + if (vdso_ret !=3D vdso_param) { + printf("[FAIL]\tinconsistent return values: %lld %lld\n", + (long long)vdso_ret, (long long)vdso_param); + nerrs++; + return; + } + + if (!(start <=3D vdso_ret) || !(vdso_ret <=3D end)) { + printf("[FAIL]\tTimes are out of sequence\n"); + nerrs++; + } +} + int main(int argc, char **argv) { version =3D versions[VDSO_VERSION]; @@ -432,6 +488,7 @@ int main(int argc, char **argv) test_clock_gettime(); test_clock_gettime64(); test_gettimeofday(); + test_time(); =20 /* * Test getcpu() last so that, if something goes wrong setting affinity, --=20 2.52.0