From nobody Tue Oct 7 19:22:11 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 357032D94AE; Mon, 7 Jul 2025 14:23:46 +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=1751898227; cv=none; b=hEeE+dCTVWtUQ/WaluYcZweKg7O6Y96oPL1KaNfAfHYDu9D4TlBdjaafbJ94cKLG3lwgUa37PKYODBUjvaz22+ThmmrL1Et7A0AVi9eBQSurAVwWkHjRgSNeJqaNTeR424koTi6OxqCVdOneRQS3rXVCbznwWRKOVLjOgfUGDUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751898227; c=relaxed/simple; bh=EayZOtBL90f6QFOcAGcEUumSQBoNWVZo7dcWx+htwY0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=t7NGYxYd5eFALAfvcjfisB1oFKw47YztrMBCsKTnYHS4KJtYX1+q2Pn94gcl9B8l75uBGvdpo9xHUw1QpFijITGLsTO9g9UPcFrnAKDR+w8ug/DNZOGh3uH7+GtzwU2QGAol1kE1/xedkKPW/Sb6UuO40yegtJpt4q+XqbX2zyg= 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=X7JIP9j0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=oLdQj7w6; 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="X7JIP9j0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="oLdQj7w6" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1751898224; 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=ka2koAAO3+tROI+op1wD/ECrnjtB2oeDRijPzGbM22I=; b=X7JIP9j0JXEqr2WXcQj/pmMMbEfiYfpmt96lOlw37C9QQokGDo/1ev3o+Ez+XuczcyWBsA DIGjLHRpS1uD9Mu2xgF5Ue4yZuyRVB5BH4NcIua2JTZOO+LBZ71CiszJOwDJfJBQj589a8 LGmPCHhOGdZ27FkkXQwqwfD5IEmA8ANVMOMZ5UT4f+fLtJ8xfZzur16mmUL6bgLpKgo8kc G3OxrdY37C5yRjOkacib3T0cDv12yG5qzJkDaVGVVNKVQSX+yh8r9oNYWzg3HoqIz7zW6l bKLuAFVMRTs93cAQ+QPdjF4+Z1898JFl6XaQTEjRiskKeWAx0IebDVTnx8/laQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1751898224; 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=ka2koAAO3+tROI+op1wD/ECrnjtB2oeDRijPzGbM22I=; b=oLdQj7w6rp2lEFRFkMh+ONSpzZtd5/N2PkjQgXRAbk1ek4rE7upMlj9n/6EtqgvuUbze/N UZEfKwD/mzFUeJBA== Date: Mon, 07 Jul 2025 16:23:39 +0200 Subject: [PATCH 1/5] selftests: vDSO: vdso_test_abi: Use ksft_finished() 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: <20250707-vdso-tests-fixes-v1-1-545be9781b0c@linutronix.de> References: <20250707-vdso-tests-fixes-v1-0-545be9781b0c@linutronix.de> In-Reply-To: <20250707-vdso-tests-fixes-v1-0-545be9781b0c@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=1751898221; l=781; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=EayZOtBL90f6QFOcAGcEUumSQBoNWVZo7dcWx+htwY0=; b=4Fv5mHOXtXabazVRNfTKCITGj26jMVQ5H7pNwRmgfmbTrClLmSx5R9vQiztpknw+28XdHnegz MB1dH+1wXlEBZU+/Jv+LnTDb+A86dXXw0GcBGmsvqjebrNmVPU1CdSC X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The existing logic is just an open-coded ksft_finished(). Replace it with the real thing. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_abi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/s= elftests/vDSO/vdso_test_abi.c index a54424e2336f4597e67668052b62cd7d6c0531ff..63eafb5ac0bfa407a527343f4d5= 87e5098454f1f 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -232,6 +232,5 @@ int main(int argc, char **argv) =20 vdso_test_time(); =20 - ksft_print_cnts(); - return ksft_get_fail_cnt() =3D=3D 0 ? KSFT_PASS : KSFT_FAIL; + ksft_finished(); } --=20 2.50.0 From nobody Tue Oct 7 19:22:11 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB1E42D8DBC; Mon, 7 Jul 2025 14:23:46 +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=1751898228; cv=none; b=kamJ9vVkIwXpJyDoQY726r3GSkatYKX/ynXjgb5CtEBmuFE+zNlO2ag9gfQ6YIl3nvBCO7cz3GVwBXJH4hi00ici3Xt+Lo0mmAqZTkM2lbY9z20G0JdsoGbsO2NV7BwARC3CdKB0eMV7jSoOW9d/QBdiY9957qSubY+s7JEqU+w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751898228; c=relaxed/simple; bh=wrsMm7nGfxkYJnYNEIzYKNcVhA3Pl9itptSW6wHUQ0Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bNXHPR4APa+1P94760OMERjp/bzQBoOEGeMGWJWYb/P+xXBRXUI+LgN2nF60Icib1mxarwaHha4OCNwS5xU6X9+UEt/OHKra+iF2DluJ212wA8JaD/4dSqp+zx/tec5ThxrKQC9GHC5mDh9Nc1k5XarlQ4JmApvB1f7sdD74J74= 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=TjQBPj3C; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=yn0CjopP; 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="TjQBPj3C"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="yn0CjopP" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1751898225; 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=EwKUprsP1ZjCWus8bQrJ7pofqpc1CikeaR7ZCtEeAIk=; b=TjQBPj3CSuR2cpxVZFhlPHV/yo6DyPTax8jUyIQBaso0sWH1Tqd4E+mw7JRn/3K2O5V9aJ 2b5y5oF8A3jrY12rVEMeKFYw1O9jpl14vPJ+qxkR7XRAxX4qnWfQCmpOptyuIB+F6C6ThP KfLDoPf2SrsX2SksVB7lU9C13dauBjLaNPKZojEVycLKwcfriWFkdmiKl5AiDvRLGcaZX2 nI6xGf5iE7GuuDXdMm/TuRaTEBQhGkVS4xPdXehoPAN6oz9oI4u1rQ6cftBP3w2yoycLcl X7YXOYl2D0OA09MweHxmFuSjucLz+vtLEXJxCgfKg4s0jHDr4K6ErLeqsRpSrw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1751898225; 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=EwKUprsP1ZjCWus8bQrJ7pofqpc1CikeaR7ZCtEeAIk=; b=yn0CjopPDxq1WuwlNHCQi9SkayUg0GS3PXN+6aP6t0yScpIF6H94Ydaq3d4I5l8M+G++Oy aEPRTRbaqUmTHJBw== Date: Mon, 07 Jul 2025 16:23:40 +0200 Subject: [PATCH 2/5] selftests: vDSO: vdso_test_abi: Drop clock availability tests 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: <20250707-vdso-tests-fixes-v1-2-545be9781b0c@linutronix.de> References: <20250707-vdso-tests-fixes-v1-0-545be9781b0c@linutronix.de> In-Reply-To: <20250707-vdso-tests-fixes-v1-0-545be9781b0c@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=1751898221; l=1517; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=wrsMm7nGfxkYJnYNEIzYKNcVhA3Pl9itptSW6wHUQ0Y=; b=xpiZWTEmLZvey5rKjg+IaauuVib/yYEkRZt42u6WEuOfS9Cwt+KMOkZOEs/w/wpFVBa8QAK5u UnQOw45s+u8CaA+RHzUf3qxPS0oKK1fsNM3NG+dF0u5ofw4MdSLBxhL X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The test uses the kselftest.h framework and declares in its testplan to always execute 16 testcases. If any of the clockids were not available the testplan would not be satisfied anymore and the test would fail. Apparently that never happened, so the clockids are always available. Remove the pointless checks. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_abi.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/s= elftests/vDSO/vdso_test_abi.c index 63eafb5ac0bfa407a527343f4d587e5098454f1f..407817e929d89ee434191e336da= 0e6f18b989a71 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -198,37 +198,13 @@ int main(int argc, char **argv) =20 vdso_test_gettimeofday(); =20 -#if _POSIX_TIMERS > 0 - -#ifdef CLOCK_REALTIME vdso_test_clock(CLOCK_REALTIME); -#endif - -#ifdef CLOCK_BOOTTIME vdso_test_clock(CLOCK_BOOTTIME); -#endif - -#ifdef CLOCK_TAI vdso_test_clock(CLOCK_TAI); -#endif - -#ifdef CLOCK_REALTIME_COARSE vdso_test_clock(CLOCK_REALTIME_COARSE); -#endif - -#ifdef CLOCK_MONOTONIC vdso_test_clock(CLOCK_MONOTONIC); -#endif - -#ifdef CLOCK_MONOTONIC_RAW vdso_test_clock(CLOCK_MONOTONIC_RAW); -#endif - -#ifdef CLOCK_MONOTONIC_COARSE vdso_test_clock(CLOCK_MONOTONIC_COARSE); -#endif - -#endif =20 vdso_test_time(); =20 --=20 2.50.0 From nobody Tue Oct 7 19:22:11 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 558B42D94B8; Mon, 7 Jul 2025 14:23:46 +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=1751898228; cv=none; b=Jy4mbGlM5ZM2QRHrUeff5YZrTjV4Bz88Wn0OAc2gk83e4jIL55d6jSVRMO0YzxvFMzUX/pivym+vnugZt+F+fxPxCAeKj0J/6nk6xQ17Sd5dYQJFbjuA334z2g9LLQ/30xZlv+0aeZ6Mj37Mvu+WWoMeKU0LfAms/VQTxsWUcbw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751898228; c=relaxed/simple; bh=Q/F9vDKfu7XaTh9AflpJQNkYDtIxfJAukiznBldYvG8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=D0o9qLrQVqWePGyXlYRV3bUbWx30fLD6xXm5s8IrjBHCCT0/jvm4vSRA8nPJvrTGOCpPUDMupvhsE9rGU7U8m/3XUffYOaHH77tdoVvM/D799L1G7/ehsCF9zlT6tjqEQpBu0DMiunI4PXrOaJlGwalJAJfs57Bih93iXnCDyP4= 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=LUYFMkNm; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rzIMMVmd; 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="LUYFMkNm"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rzIMMVmd" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1751898225; 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=qBqbw4PdzPyuPrlKENbYISEQyRJfwMczckSvk7p27gQ=; b=LUYFMkNmXmW3U3cAaVQgV+PDog/MWpXTZ4sYpfiSQ5GGO5sxXQPVtryHmmOv3/ZUDka6d/ h3T7h1qw0uw1KqPHx+o9nZLubYjhdSfuXRN30Om0h0/onXqX4q4CpJwpKAAdL0CoplRTZl vjTzZDtMEatZLFkCaPgif8wrGOhzr/T+4HsUCuT3TE4HiHOZ6P/sHLUcBENUwacOA6y7rG ihoXUjib8FBxRux5Nwz+MNNeqLicLn1FtNukJ9HyeKekzCL4gh4qlM3WNj8K8CHH1u+7WS T1a+jN5Wmr9HVAgKXY+hKRLvEy0TG2JfQC7RmVY0ns9fJNQRlCTIfHN4IuBFkQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1751898225; 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=qBqbw4PdzPyuPrlKENbYISEQyRJfwMczckSvk7p27gQ=; b=rzIMMVmdpHRaCpBXp/yd4hUcGqNGHD35D89zrqJqbs1O0rg5JyqRH88mBG0NDzYY2mRjJS VexDff3jNemMPCBA== Date: Mon, 07 Jul 2025 16:23:41 +0200 Subject: [PATCH 3/5] selftests: vDSO: vdso_test_abi: Use explicit indices for name array 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: <20250707-vdso-tests-fixes-v1-3-545be9781b0c@linutronix.de> References: <20250707-vdso-tests-fixes-v1-0-545be9781b0c@linutronix.de> In-Reply-To: <20250707-vdso-tests-fixes-v1-0-545be9781b0c@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=1751898221; l=2009; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Q/F9vDKfu7XaTh9AflpJQNkYDtIxfJAukiznBldYvG8=; b=Hfyp7uArTsKNdw/eAkznj4+Nbrpg6i3gVqiH0gxgaznGYdjJYnEap6NVjBcZMv70pCCshFTJw XIoV1qq/AskBPCejOiY2VbUV2FKAgKGOCTLNLSR+KourOx1IR6Hy2qH X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The array relies on the numeric values of the clock IDs. When reading the code it is not obvious that the order is correct. Make the code easier to read by using explicit indices. While at it make the array static. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_abi.c | 26 +++++++++++++-----------= -- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/s= elftests/vDSO/vdso_test_abi.c index 407817e929d89ee434191e336da0e6f18b989a71..96d0dd3677b357876e92f6d2d96= 2d43d642e9bee 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -31,19 +31,19 @@ typedef long (*vdso_clock_gettime_t)(clockid_t clk_id, = struct timespec *ts); typedef long (*vdso_clock_getres_t)(clockid_t clk_id, struct timespec *ts); typedef time_t (*vdso_time_t)(time_t *t); =20 -const char *vdso_clock_name[12] =3D { - "CLOCK_REALTIME", - "CLOCK_MONOTONIC", - "CLOCK_PROCESS_CPUTIME_ID", - "CLOCK_THREAD_CPUTIME_ID", - "CLOCK_MONOTONIC_RAW", - "CLOCK_REALTIME_COARSE", - "CLOCK_MONOTONIC_COARSE", - "CLOCK_BOOTTIME", - "CLOCK_REALTIME_ALARM", - "CLOCK_BOOTTIME_ALARM", - "CLOCK_SGI_CYCLE", - "CLOCK_TAI", +static const char * const vdso_clock_name[] =3D { + [CLOCK_REALTIME] =3D "CLOCK_REALTIME", + [CLOCK_MONOTONIC] =3D "CLOCK_MONOTONIC", + [CLOCK_PROCESS_CPUTIME_ID] =3D "CLOCK_PROCESS_CPUTIME_ID", + [CLOCK_THREAD_CPUTIME_ID] =3D "CLOCK_THREAD_CPUTIME_ID", + [CLOCK_MONOTONIC_RAW] =3D "CLOCK_MONOTONIC_RAW", + [CLOCK_REALTIME_COARSE] =3D "CLOCK_REALTIME_COARSE", + [CLOCK_MONOTONIC_COARSE] =3D "CLOCK_MONOTONIC_COARSE", + [CLOCK_BOOTTIME] =3D "CLOCK_BOOTTIME", + [CLOCK_REALTIME_ALARM] =3D "CLOCK_REALTIME_ALARM", + [CLOCK_BOOTTIME_ALARM] =3D "CLOCK_BOOTTIME_ALARM", + [/* CLOCK_SGI_CYCLE */ 10] =3D "CLOCK_SGI_CYCLE", + [CLOCK_TAI] =3D "CLOCK_TAI", }; =20 static void vdso_test_gettimeofday(void) --=20 2.50.0 From nobody Tue Oct 7 19:22:11 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BD6E2D94B6; Mon, 7 Jul 2025 14:23:47 +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=1751898229; cv=none; b=erLtrvOzwucBt8kJ6ufrvOPIR55zew8bt3HB/xK+hlRLA0jsBZnlZOAQE+uj0rLZvaTqYfxevCvbjIWRup7eBunANq/8uuH1oOAKyv6nzCd16eD2L8izEkGFjnHQrjKlMs02uWCFuDDO9kNX5MlFWKyzM85VR9jdvIO/Cepdfbw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751898229; c=relaxed/simple; bh=202eE0zeDU7+HUUBg0x+87B7hcMlBCKZldbKn5GARlY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CcVggpTWFqBLxhGpobisVIuNga64RM9Or01JtOdNc/+szlhmYaGTJSYkaNAiOKKJrHyVt+vonqFv/Nji2RLfFBgLuel//QQW9mtK9B4ecWbNOvrqMyRhFKqj1NZTKJdPL/UZVSJSNX+VXmagSF8vxdha82rfLYBdLc55ctravWM= 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=MBMtFoy/; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=9SoTZlgV; 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="MBMtFoy/"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="9SoTZlgV" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1751898226; 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=9gA6/FzdcDZ1OiNdUSIXGLqRE2/eOLi8nixIKqmz03I=; b=MBMtFoy/EwJyHePKacClzU/1GzV9Rr5KKyVaYj4LGATkt0AHBY+/pmGj3JFr38lAzXBX72 XsblNG8Qv39PK/jjdKcQQ3OihUmlKPJvW40ju7uAn1w+X65Y6/e7IJTiZWrMOA/EUT45jD KUA3p/0EN4uqjo9nDW1M1MPpzz+lOj5Idd/TZMFRmTXdAlC+Rlc6WCeflsqfkPk/9H71Kp zciG3zEYsogsOG+3uwKJuNrvhh15SZz256xlIvVdwuXkhkgRYRwZmlFXS72kRfoeGMiKvu e7nKNpOOdP7KE4ryLB39hsm64+GfCEaa02kAuwn/euCCVZNixO3U8yCvBhWDFw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1751898226; 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=9gA6/FzdcDZ1OiNdUSIXGLqRE2/eOLi8nixIKqmz03I=; b=9SoTZlgV7KocbRPCexI9NTkFyzUlqGFo6KDuk4IfrNU2woHDwUk0ywGpcyh8aPCGzV1IJA 8ySF/DTKIBjZccDg== Date: Mon, 07 Jul 2025 16:23:42 +0200 Subject: [PATCH 4/5] selftests: vDSO: vdso_test_abi: Test CPUTIME clocks 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: <20250707-vdso-tests-fixes-v1-4-545be9781b0c@linutronix.de> References: <20250707-vdso-tests-fixes-v1-0-545be9781b0c@linutronix.de> In-Reply-To: <20250707-vdso-tests-fixes-v1-0-545be9781b0c@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=1751898221; l=1087; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=202eE0zeDU7+HUUBg0x+87B7hcMlBCKZldbKn5GARlY=; b=VS2tHHgjAUSlFaq2psunhleNFpzY8tOCh9hZoryfhN8/UsqGCAv0qWZvatQQu6mWbArNNGGT/ y7jUKaetyBlDI9SaMFWW9OvIrvhlGq7ZxH/7cgTVAza9/gVi6leTRiV X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= As the framework is already there anyways also test the CPUTIME clocks. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_abi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/s= elftests/vDSO/vdso_test_abi.c index 96d0dd3677b357876e92f6d2d962d43d642e9bee..08ed8ddd18edcd5a9f5d8239124= 833882a0b5dec 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -175,7 +175,7 @@ static inline void vdso_test_clock(clockid_t clock_id) vdso_test_clock_getres(clock_id); } =20 -#define VDSO_TEST_PLAN 16 +#define VDSO_TEST_PLAN 20 =20 int main(int argc, char **argv) { @@ -205,6 +205,8 @@ int main(int argc, char **argv) vdso_test_clock(CLOCK_MONOTONIC); vdso_test_clock(CLOCK_MONOTONIC_RAW); vdso_test_clock(CLOCK_MONOTONIC_COARSE); + vdso_test_clock(CLOCK_PROCESS_CPUTIME_ID); + vdso_test_clock(CLOCK_THREAD_CPUTIME_ID); =20 vdso_test_time(); =20 --=20 2.50.0 From nobody Tue Oct 7 19:22:11 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61CAC2D97B0; Mon, 7 Jul 2025 14:23:49 +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=1751898231; cv=none; b=RgfZyG5P0dbvoSKDwY5uqwgDaNRhQbmBG8ct/qQHKOthYssFynD8O20UNt3Bob+/HEAlvZpXxcYrGAc0ipiFw2AVeda88MIEBQnrgP290GrM4ZJBsBvVg2lcScl6yT5mS+C3RyDov23oFou0eZFAju7nlvog5AYqss8vIt0rmGY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751898231; c=relaxed/simple; bh=s4skLLJfopoH2TWuLw68jE7DlOUR1hAhAHbxjOf1rD4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tM330s0PSn8nSDt5KMZqaD08XkbYjF8qYMnKBdHLRgkaBZiupGkvifEPpC2aXZx7WQxu32dIOKPV6cQ0N2i65n6tc5L+xseXalv+tGP4r7tkqJNSLTa/8xPMJ4ZYM+ZyIke+5KOvkUIM8ljyR1RrwLXhkYIjtKMxrN7vehD2FXM= 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=mpRJDZPO; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=cPt4+3lu; 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="mpRJDZPO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="cPt4+3lu" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1751898226; 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=Pq7ctUq5bHh87KWv51A0aETgmBc6Ve8Sl/O21M03X6U=; b=mpRJDZPO50o4vLQGEJyB0M8/8hdc6gStYxDq1KdA04K6AQHDrLHTnnQKVppcDr2koFm9b8 4BUf04l313w1JWbKQSi+QHn6p3V84rkJu7yBaf7aAWJa2OMcLgCK+o78ginBdrcuN4sMCa +m2Qluu1Se+KsaRz0Oh1QmazSi6n4lySVYstE+u9r4jRYcbxTJi4mRHzPulmiVFC1baksn i1Ljq95JE3+di26R1TmYMee30QZBvtXnBQ38GBe7JvlNUyu34bMYCiNE1Ly4NkR3h82uXH FIslPyJfrvbM/zWwPc4f0jq2Bu8kVQvffuX5xyM5snwM+l8UqYYrjg6+GvVTvQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1751898226; 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=Pq7ctUq5bHh87KWv51A0aETgmBc6Ve8Sl/O21M03X6U=; b=cPt4+3luq/Srfd+rPwnvWKZEYrbFquBBeM2BftCIaCESBpai6SNgXxZQxKTMpCdo5jouLx MJ4ev5xiGTJYUZDA== Date: Mon, 07 Jul 2025 16:23:43 +0200 Subject: [PATCH 5/5] selftests: vDSO: Drop vdso_test_clock_getres 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: <20250707-vdso-tests-fixes-v1-5-545be9781b0c@linutronix.de> References: <20250707-vdso-tests-fixes-v1-0-545be9781b0c@linutronix.de> In-Reply-To: <20250707-vdso-tests-fixes-v1-0-545be9781b0c@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=1751898221; l=4660; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=s4skLLJfopoH2TWuLw68jE7DlOUR1hAhAHbxjOf1rD4=; b=BdSEX7GiS3a04xCqvPsN2BEpFMTb2uoea9+n6lt+PyQCcqFtumBOIJrIZh7r1fqniCZ5KyXij 4BbEnAPPc6xDkmGGN+F17nyHXQERyHu02GVXCnQpCCipzklH9DgWs1z X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= vdso_test_abi provides the exact same functionality, properly uses kselftest.h and explicitly calls into the vDSO without relying on the libc. Drop the pointless testcase. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/Makefile | 2 - .../selftests/vDSO/vdso_test_clock_getres.c | 123 -----------------= ---- 2 files changed, 125 deletions(-) diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftest= s/vDSO/Makefile index 918a2caa070ebc681a9525f0518afffcf10f5ae3..e361aca22a74dc5c279ab1aa16f= 308b7e6e85bf1 100644 --- a/tools/testing/selftests/vDSO/Makefile +++ b/tools/testing/selftests/vDSO/Makefile @@ -4,7 +4,6 @@ include ../../../scripts/Makefile.arch TEST_GEN_PROGS :=3D vdso_test_gettimeofday TEST_GEN_PROGS +=3D vdso_test_getcpu TEST_GEN_PROGS +=3D vdso_test_abi -TEST_GEN_PROGS +=3D vdso_test_clock_getres ifeq ($(ARCH),$(filter $(ARCH),x86 x86_64)) TEST_GEN_PROGS +=3D vdso_standalone_test_x86 endif @@ -29,7 +28,6 @@ CFLAGS_NOLIBC :=3D -nostdlib -nostdinc -ffreestanding -fn= o-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_clock_getres: vdso_test_clock_getres.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) diff --git a/tools/testing/selftests/vDSO/vdso_test_clock_getres.c b/tools/= testing/selftests/vDSO/vdso_test_clock_getres.c deleted file mode 100644 index b5d5f59f725a703c357dfca91bfe170aaaeb42fa..000000000000000000000000000= 0000000000000 --- a/tools/testing/selftests/vDSO/vdso_test_clock_getres.c +++ /dev/null @@ -1,123 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note -/* - * vdso_clock_getres.c: Sample code to test clock_getres. - * Copyright (c) 2019 Arm Ltd. - * - * Compile with: - * gcc -std=3Dgnu99 vdso_clock_getres.c - * - * Tested on ARM, ARM64, MIPS32, x86 (32-bit and 64-bit), - * Power (32-bit and 64-bit), S390x (32-bit and 64-bit). - * Might work on other architectures. - */ - -#define _GNU_SOURCE -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../kselftest.h" - -static long syscall_clock_getres(clockid_t _clkid, struct timespec *_ts) -{ - long ret; - - ret =3D syscall(SYS_clock_getres, _clkid, _ts); - - return ret; -} - -const char *vdso_clock_name[12] =3D { - "CLOCK_REALTIME", - "CLOCK_MONOTONIC", - "CLOCK_PROCESS_CPUTIME_ID", - "CLOCK_THREAD_CPUTIME_ID", - "CLOCK_MONOTONIC_RAW", - "CLOCK_REALTIME_COARSE", - "CLOCK_MONOTONIC_COARSE", - "CLOCK_BOOTTIME", - "CLOCK_REALTIME_ALARM", - "CLOCK_BOOTTIME_ALARM", - "CLOCK_SGI_CYCLE", - "CLOCK_TAI", -}; - -/* - * This function calls clock_getres in vdso and by system call - * with different values for clock_id. - * - * Example of output: - * - * clock_id: CLOCK_REALTIME [PASS] - * clock_id: CLOCK_BOOTTIME [PASS] - * clock_id: CLOCK_TAI [PASS] - * clock_id: CLOCK_REALTIME_COARSE [PASS] - * clock_id: CLOCK_MONOTONIC [PASS] - * clock_id: CLOCK_MONOTONIC_RAW [PASS] - * clock_id: CLOCK_MONOTONIC_COARSE [PASS] - */ -static inline int vdso_test_clock(unsigned int clock_id) -{ - struct timespec x, y; - - printf("clock_id: %s", vdso_clock_name[clock_id]); - clock_getres(clock_id, &x); - syscall_clock_getres(clock_id, &y); - - if ((x.tv_sec !=3D y.tv_sec) || (x.tv_nsec !=3D y.tv_nsec)) { - printf(" [FAIL]\n"); - return KSFT_FAIL; - } - - printf(" [PASS]\n"); - return KSFT_PASS; -} - -int main(int argc, char **argv) -{ - int ret =3D 0; - -#if _POSIX_TIMERS > 0 - -#ifdef CLOCK_REALTIME - ret +=3D vdso_test_clock(CLOCK_REALTIME); -#endif - -#ifdef CLOCK_BOOTTIME - ret +=3D vdso_test_clock(CLOCK_BOOTTIME); -#endif - -#ifdef CLOCK_TAI - ret +=3D vdso_test_clock(CLOCK_TAI); -#endif - -#ifdef CLOCK_REALTIME_COARSE - ret +=3D vdso_test_clock(CLOCK_REALTIME_COARSE); -#endif - -#ifdef CLOCK_MONOTONIC - ret +=3D vdso_test_clock(CLOCK_MONOTONIC); -#endif - -#ifdef CLOCK_MONOTONIC_RAW - ret +=3D vdso_test_clock(CLOCK_MONOTONIC_RAW); -#endif - -#ifdef CLOCK_MONOTONIC_COARSE - ret +=3D vdso_test_clock(CLOCK_MONOTONIC_COARSE); -#endif - -#endif - if (ret > 0) - return KSFT_FAIL; - - return KSFT_PASS; -} --=20 2.50.0