From nobody Thu Apr 9 12:08:34 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 AE37523A984; Fri, 27 Feb 2026 06:46: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=1772174762; cv=none; b=joUbC5okdnbMhgBReLbD32EDDmK/5goEufwcLr9hpTYZ7P+8aTemTKJXHl00TEaCDB2oT0hP4tekEoh5hAO65HcSz78qnDgY3SuUe9n/2EZLr1qDewAgtmLx+fvUreN/lq3WeKJUWvD21M+MMKkgvNVpUMAmAFxZNyN8lhn2x6g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772174762; c=relaxed/simple; bh=MTmWB0bXTOPbqEKxHXK4MezAC5ZE1vjLmKBCWVLi5SU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r0ywVsTl6+hsILN9JzEznt8niChEe5NCXpB7UzKFjgxsbFRYjJAGdcqayrKiOsIROOAW4pJDb86gIkC6jK6loiVi460dOpvW5lxnYpN+c+a0ySfGLZmrISr/agNr/s6xPfRx1QOINrnSQhF7dDNbrwC58kDUj/8i516eErGBxok= 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=eMMztogJ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=I+k8ZGU7; 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="eMMztogJ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="I+k8ZGU7" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772174760; 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=SAjxhN5A2qW4aDOymQOc+aoMJsVeojoM0YwpR0hVCk4=; b=eMMztogJkD3TN06jB5QjKTDgeOOjC9CTIlpdX0W3Le9EAUOiD6qc+Ol6ZfwdxntUoi5oGX kAEtYLhCpi2Eb6xzJK0KZwBSGJxZ6lyJAWCRGMhIlWLsEAgEbXHRm1f2iF02Qd9va4lKqe mpwx8hvvWE6cTVxJFWZBRYzAcS0GkNIJmwWrYcTtSyBW2oW2YkNdpF2KzJMbCkGxyQgLPb W68xFYfIez2VdwOiVm/N1PiFZypESVOrZPn7B5D8OHwA3rZNNCBRUYh+vnTOufyQiljqQ0 q8TkeOKQTBr30yow2SojhOYVzf9YJmXYSqAqdY4etK4a587CEJodZjPWkHAVvA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772174760; 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=SAjxhN5A2qW4aDOymQOc+aoMJsVeojoM0YwpR0hVCk4=; b=I+k8ZGU7NH49Xlc01XPoc8zQ7VPslXlXfbUb0cs6bFU/YV+zZDGjgxBB90AHrfIB0u9Rbh 7r0Mia/QyuAIrTAQ== Date: Fri, 27 Feb 2026 07:45:56 +0100 Subject: [PATCH v2 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: <20260227-vdso-selftest-cleanups-v2-1-d84830fa8beb@linutronix.de> References: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@linutronix.de> In-Reply-To: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@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=1772174759; l=1734; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=MTmWB0bXTOPbqEKxHXK4MezAC5ZE1vjLmKBCWVLi5SU=; b=OBjNjAzH7ojy/cuA40LgwrUracQA7jM9jjEZn6O16tn0JpwGrKI494NE0pX1jkVA8sWJq1Tjg PBKE+c9RwmGCjYD/3/rLEhAWMfmMiWgeW6onEjC+ckYCPCk8Nad5qDf 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.53.0 From nobody Thu Apr 9 12:08:34 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 1CF383375C2; Fri, 27 Feb 2026 06:46:03 +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=1772174764; cv=none; b=oprASzosOV6GVsNt458a2j9N3MKqEfdgg30k5D/L6h/OCcWfZErQcaBpUtB/OBzRCUBLVRiFZ8X/ZGmEKoDsMajPFZChzjnmB3w0y6RU4Qs72jBtq8SG2lbktbThKnYYZo8EtWljcSPfxXvfrK5gdsUSnF8rDHNjifuT9eK6c6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772174764; c=relaxed/simple; bh=U+t8Mi7k+VBsSnk9ZpACgCqoKeOG5zfWruqbCgkLLqw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IJpKbJxEbPLWy4gmJ3I0OBZLKRttTFuLqp99p08nQUX/XfExKviXsBxruZwtubQkawqZZSLWouf27gX/iwKEAflDVpJ1ZhXjfFqWw9cTrsZwwM8llNGt5FvOpizMoZCCVvCswk1N5lpd27LQoJe9dT4qTEbrYgGCjK+Mqixxo1Y= 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=XXto6hJU; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=XMSAwZn7; 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="XXto6hJU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="XMSAwZn7" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772174761; 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=95XbjX6n9fcYSFAHJRgRE0KDt27uVwK1J51Urtrslhk=; b=XXto6hJUcESoh4QsH5pMLrzVD5N1KdgdrAZsQFauXqR4byi1yBuUJwDg7fM6YVGWfk5SeM B4dDp2AXqS1a5EWEWWNUTIawwZ1M2oH0mpltx4gtrTuG7bf+Ryj4+RXiLuObcY+qiL6o0g bOMds6R8NT+UMFcxuz7krRURAZ3chJnGGBZRAUrmjvZh9MiBdy6Hnv0DFeGlSZWJvT9gpe JesFN1itxiTZEN5zUlJFcepKVB4idlcXpVpLIR2UMZIV4hQLDQOHYKhCWijktYSA13pK/U KkaOXvPX3/jXAVVBNwh/a5Kufnr8yPkzdib0tf1hJY7tFeJmU0JZm3f80mES/g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772174761; 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=95XbjX6n9fcYSFAHJRgRE0KDt27uVwK1J51Urtrslhk=; b=XMSAwZn7U1uM003Va4OKoVpHxvThC2SVxfF89GNPFxH+WHl3m83ba6/4hdvys42Dz4Ej2I PJMT8VHiJwF5X1CA== Date: Fri, 27 Feb 2026 07:45:57 +0100 Subject: [PATCH v2 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: <20260227-vdso-selftest-cleanups-v2-2-d84830fa8beb@linutronix.de> References: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@linutronix.de> In-Reply-To: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@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=1772174759; l=719; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=U+t8Mi7k+VBsSnk9ZpACgCqoKeOG5zfWruqbCgkLLqw=; b=Oqf+JKSXj7UNEP6xqO+waQAaEKEcK/go65rEPfuRO5VxwRCkfKVdrPZKJkkYtEVyCxvOCw6GS 081WWKRc2+1C4gbUJHMVWWDEA2z/FX0UB66767K1gFKciG6mS2J1W0G 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.53.0 From nobody Thu Apr 9 12:08:34 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 C91423E9F83; Fri, 27 Feb 2026 06:46: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=1772174766; cv=none; b=Uohu5qv5z3JOi8RsNkZgWQcgvtgNrdV96YuR0uPlZ2ppr7d8iDevIWhShFmRY7dNEP4A83cdAZmVu5atpCeVs2JEi7YhhDBxWWOujLXl0taKxxPZCPhc7TXF96ByTxZgXAMjyeI6ayTj0tzltlIuVet3ZJyeA/PnaYxspdbvl/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772174766; c=relaxed/simple; bh=rfzm73bfkrptOgHpM8yLIrYhzp2cZHXl5ElMlQSXcRM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JH4jqAs38fc8qwKY0WC19hIEyADG+lf0ee843JjoXhtLmZoWftBto2YK8ek2HF2nCHpOwK5AT6k+i86Q6QHW3TaaR0RT3GGzvZdgWV+8Sf/IVCnbmK0P659P1bhpODfgANfiiU+AYpFkHbMX3au2lIdPnq0AvIPZZAGV1ogwY54= 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=dzUd0w7/; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=38uj6lZC; 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="dzUd0w7/"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="38uj6lZC" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772174762; 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=N3GsQdcdMBszNDuQPGFvk3xaLQW8ZKLNlkl6+18g9Aw=; b=dzUd0w7/fsSTOjGi+1D0f+kfH0ecPLl5gYjTWuf4Ay4KpEEUTQ993JfZFSv0Ry6JZZ95Om 5DJBLccqDh3nFxY8gscHzNNj5kYzo+RnMmCkIRepxXXwH+1kn7nF/++ZPVUuoruJ01YpgN 0bqfXGxKHn1tZMx4OGllCb4qF58Hs7xsEqif95tBYrnelp4Y0hOo4Z4a2lrCOIlH4Aos5w E0h4QD60bLA2DvurOhNwW+0YmJvEn+621S5zS/yR+kPUVsf0yOcGg6vii9x96C5vjQnjgC 2fl/vCI/RvexS15M7t05aEGx7Miruwv6rh+VcFGqWkeBNGP1Cp2fa5lKcUKZxA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772174762; 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=N3GsQdcdMBszNDuQPGFvk3xaLQW8ZKLNlkl6+18g9Aw=; b=38uj6lZCKDyz/54knPtzhqNZ92NFxhz5b05H8gsqBRlh0VvcRSCzGJ1dz5mJIbLT6K2cvA 3B9CbZ8P79fFEYDA== Date: Fri, 27 Feb 2026 07:45:58 +0100 Subject: [PATCH v2 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: <20260227-vdso-selftest-cleanups-v2-3-d84830fa8beb@linutronix.de> References: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@linutronix.de> In-Reply-To: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@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=1772174759; l=802; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=rfzm73bfkrptOgHpM8yLIrYhzp2cZHXl5ElMlQSXcRM=; b=leC8mEOxir/sxssHL0A7UODhQLtp2BC6v7u9nbJQ3OspD/86hF97ALx7L6CiWLV7EqmRmq6N1 oQgi3jGySURBdllvnpIx+n9GTqis5o989I+gTbqyYXZWyT0BURiUyVa 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.53.0 From nobody Thu Apr 9 12:08:34 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 689A52D7D3A; Fri, 27 Feb 2026 06:46: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=1772174766; cv=none; b=QCu+Q8DNDY2VQwSncAhHDXmRmqYXkNzPuI6+EzkE2nbABAp4jTJHcIFWhNYK6cWR9FzySmCcQB9cIhhMMAtTUkBVrbnQlgoiyMa7kV3F5T6ZtmIhnKADPmlDDCcGHpT2Gs9rPSfzkBeXpOuRvKdLZbSCrJbjQENkglIhv97ffs0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772174766; c=relaxed/simple; bh=BhJnU+XZ7s4nOTcoHQXDrcC+wyWHHM45cwIWYc/VP8s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FFJbWifoGyIkMYV7/MlJXLfRpkXH5OZcAHAiC3DS19xgN1cO6THg824v/aPDCbiv/0PDDrAnn+d/rCJq2GdiNijO/ZQOlWldjfIG4mfsZUPmnNmGocSwjrvXghuOn3N8YSMxaZmCePTD80cMumIvI1XIv6BY7Uiov8r32xOCRgU= 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=vRVEDkT+; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=z8htRvo8; 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="vRVEDkT+"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="z8htRvo8" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772174764; 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=gJ9I+RUYqBJ4s4WEyJIFCtXGrhWGow04KzyKm4o60kM=; b=vRVEDkT+g3WG+uQuwli7dkI5v5ldlGQS6N1l0Oqmmnhuo12mibHcpa6qmFY3NUbFEtzEtw QzULl4q5XT9DaUnzrcwtqoSMJFl/mbJAZIL330+FIA54fFtlpl0BnRiQCgAkcilyAP01Bz f8rnMkAuoB9CVQOUtt0qESt/JSHDrIMKAmCnXZu9blnnUXSHxID7+LW80Vay7QrI6O3YL4 D3CQSTQ5XvVWjSS/aO4H5DVjkAO0C7XU2sSTUbLAkGk4Nbw63m7X0oTWBxKJ2QRudjzxQS Xu1uzemI4djvEALyJfEJmakNnY7f4CInBJRpSrqBLFdmpNi/ViF01tb5ckDNcQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772174764; 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=gJ9I+RUYqBJ4s4WEyJIFCtXGrhWGow04KzyKm4o60kM=; b=z8htRvo8GPN5sNcsbrdiesYX6kIu41wZPo1bDxEXWbDNutKzYAyWZZhMyP5fL9fbbPfiBV CG+Mz2O0kcGg9iCA== Date: Fri, 27 Feb 2026 07:45:59 +0100 Subject: [PATCH v2 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: <20260227-vdso-selftest-cleanups-v2-4-d84830fa8beb@linutronix.de> References: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@linutronix.de> In-Reply-To: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@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=1772174759; l=1580; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=BhJnU+XZ7s4nOTcoHQXDrcC+wyWHHM45cwIWYc/VP8s=; b=Nq6f2KspAk6WgXdavI3EYKlDPVXwDASORmGQcfs1/yFN/FFF9TUJBpjqYrI3bUyszQXCThOk/ WXKNOulS1AWCukW8DQdkQ9445YTTDTeAamDjkcMJJl1gVxZJcBTnd11 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.53.0 From nobody Thu Apr 9 12:08:34 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 06CA63ECBD2; Fri, 27 Feb 2026 06:46:06 +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=1772174767; cv=none; b=kjhUlLBBHKs806YJ7p54euCTQ1LdvBIspgLvhM8KzjlM7uq9I24fq24566Jo4GblTOwd8NKLCBfl8Ilj/kIWCP2Q5hiqYrabsp0MBxb4N1/qUDrRSPBCggmTaGyFMntWmC124Kqgb2Bw6zbdNGeqJLJXedCoFuFXnx1lYdQ2o+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772174767; c=relaxed/simple; bh=QJMybOX9OzGtSZQCKdMpT0WREYp0r6b7yNMdehba/rY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gEZ0hasg6p9pUPDTT42d9lXiFDqcfltAYtX/yQmCX+rBR0sA1JUf6k6pCptMXTbyldn7Hw7Dx/GgrrAXgNptB3++mye12Fb6MnpG9FNkG1SUJGf3flokZ/t7WHaoQQo8CsD3jSlQLGwvKFdWyJf+3iQOiKc5yfK+sUaY1nM0Ur8= 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=pfhCUZKi; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=mdhfMeVN; 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="pfhCUZKi"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mdhfMeVN" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772174764; 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=Ufhnx4JeHKyHe742vQeks9fGQvpbO2kyDWtB8r2S2X8=; b=pfhCUZKigC/+I6Ky2++bQcer4UgWcNmpKTqjtKXrW54Mc7z1J6w7qKXIwuhmjb8soXTZZb TQF3B8RovSQRi4nLM2XoT18zApoqZkQC4x+ITk0efUv1ZwelEnakPwsc0v6oGlbLOI8xfS krVe8+9rjHT7J/EWWFyUkTqwh3XjsEUGxDL5eSecmwAvL6+yNdPnuGLTNiTHC1j4omXD2w Q8UEUCdh5DyRGKwLb/uYArB42D/XccBLLoxdtd4jZCIxI+W9AisUV2dPM4n53uLnzycxB2 1jjbe5Uc1chHQH9tcKZG74V7NldgFmyEh/5ayY/fh4pvLiN0azjwxLUwHKYkag== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772174764; 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=Ufhnx4JeHKyHe742vQeks9fGQvpbO2kyDWtB8r2S2X8=; b=mdhfMeVNYUwMHS9K7XURuwnPtS/wMKNJMYoYTiNTlkuHgdT2oW7b03Ad4XfaBstpvVIewt XDsYDLiMokXNnWDA== Date: Fri, 27 Feb 2026 07:46:00 +0100 Subject: [PATCH v2 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: <20260227-vdso-selftest-cleanups-v2-5-d84830fa8beb@linutronix.de> References: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@linutronix.de> In-Reply-To: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@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=1772174759; l=4190; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=QJMybOX9OzGtSZQCKdMpT0WREYp0r6b7yNMdehba/rY=; b=imbeRzC/066sq3HzGO6qlpGwl7r+6XRI12/EXModBqA8F4aVikcuJmQ6Hmeosemivan+sV/gh 2q81yISqUaSCZDVJIEd+UJJKLQI5TvBis6NeCi0FyfM3XQUXXGXGR8Q 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.53.0 From nobody Thu Apr 9 12:08:34 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 8724A3ECBFC; Fri, 27 Feb 2026 06:46:06 +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=1772174767; cv=none; b=tQgzJeh96eep+kH+4k6u3gc0Z/f/lAu8Vj9dIXBaOYmn97ApsKw4GozHe244Lz5S5ChfKY6Ju08MFSSxtP8NBQr9c/UM6GbsILONxVn3l/LYVhRQQdZeTDuxTgup/OTV6VNiuRxBWH4XWYOMc7YLaUoqWxBD2KUDYTw9kmGkhbY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772174767; c=relaxed/simple; bh=KtqNHU7wD2sCSz2s5rhDGX2wVCKqF45UIkAV4kmR3uU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Q5/oP7/Mag8GIptUODcUaK+S2ULhGfli0S66XXP4eIwmWgS7AWZi0vBS7sXcDMlhhAx/OKJH79A81upSwJlYZK1gOF4j77RonFHMsNIiA9EtsRkhfQ+3I2+ThjyniOkmF2GcpUtpsOKURknqIkCY6dAvlOwUXhjR+1sMj3Lh1KI= 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=Aq8EILhF; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=sVs+85LA; 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="Aq8EILhF"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="sVs+85LA" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772174765; 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=AgcdgWu3vCBzJsk721i7VUjvuKqv4KR1jMoeYjmaNvs=; b=Aq8EILhFdM3J9k8ADO+afGyPBF1wjJD7IqTzQlihB9hnCk3GBW5YUrjnLdRJGGu2fKGZ43 PzrDs87hlXCho8d1aw65DL7LFlsjWsbEQ5M14vmk7omUmM7t8y6Y3fzd0kQtx0mIiQPXth BKLmTCQlDOpKVECqo0h/RZv0fnJ5Gpzwz2lsNqfhWBkpuN/alYPLTkVA9WUcXVcGdS5+cS Jd7hrANKF6oiIZ8FwVzIodKGFMy/Gn1C/m+PGyl3ublS9EsfW25r2Ryjll90vHF0h5AV38 3JnjBXqN1omIWax4Z+z1H3AMJfuIL36+a2eo80EKBgZeCo0F/9P/0cXyxVnQCQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772174765; 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=AgcdgWu3vCBzJsk721i7VUjvuKqv4KR1jMoeYjmaNvs=; b=sVs+85LAAew06XzQXOW+KptBwGiqmutT2Tnu5wdwFwMuCrsx09+C3ZTbUbQSPaLK2jbuAQ 2hikdMFss6uKpcDA== Date: Fri, 27 Feb 2026 07:46:01 +0100 Subject: [PATCH v2 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: <20260227-vdso-selftest-cleanups-v2-6-d84830fa8beb@linutronix.de> References: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@linutronix.de> In-Reply-To: <20260227-vdso-selftest-cleanups-v2-0-d84830fa8beb@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=1772174759; l=3063; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=KtqNHU7wD2sCSz2s5rhDGX2wVCKqF45UIkAV4kmR3uU=; b=mAFHHHbTqAKnXNAgVz2DREFwql80U7nglbGMLG0JLZqv7T/0WFaQMhW5J6OX/fD+NTdS/n6ME 9B113971goRBmUTY4bDCv8dZ+lKrZmZxQ3H5ffFiL1lDLPL+yA+qZvr 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 | 66 ++++++++++++++++++= ++++ 1 file changed, 66 insertions(+) diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/t= esting/selftests/vDSO/vdso_test_correctness.c index a94ab4d597b1..5c5a07dd1128 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,16 @@ static inline int sys_gettimeofday(struct timeval *tv,= struct timezone *tz) return syscall(__NR_gettimeofday, tv, tz); } =20 +static inline __kernel_old_time_t sys_time(__kernel_old_time_t *tloc) +{ +#ifdef __NR_time + return syscall(__NR_time, tloc); +#else + errno =3D ENOSYS; + return -1; +#endif +} + static void test_getcpu(void) { printf("[RUN]\tTesting getcpu...\n"); @@ -422,6 +440,53 @@ 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) { + if (errno =3D=3D -ENOSYS) { + printf("[SKIP]\tNo time() support\n"); + } else { + 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 +497,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.53.0