From nobody Sat Oct 4 22:35:27 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 4362028B7EF; Tue, 12 Aug 2025 05:39:16 +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=1754977157; cv=none; b=Dv/ENSVquZV3WMcJXjNtIbNcoGnzQVIy3ygl3f1r3d541slIdtF6RN+xzxafsdtYI9J8rHn17T31jBZEyAMeapO4luuSjHpuJP/S1WM/CYM3Zf2RgNDutMibV5cXV5iUJzkap2cAz1CzWdmbRgYOf2m4va285FMG0thyUNHryQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754977157; c=relaxed/simple; bh=QrlHtet0JRu7nFXpAhs1+5+M+BKn0zdv3choxoyODIc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vog5iNRoy89AVszYJDcqrOmZ8WFAgBLcBD5ossRsuPVJSSEQUKFJ7/uDylqU1Efuzc/Gt0cjudXgtorMVrFBaTNvoWyZ5Zt43hDaJ7Xu9L9sGFPCa8SIm/aACXzLmiWzOUR2NlD0wYqAO/JfToDdbCTHvsmBNPf0tflSmYi9w6E= 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=ZD7hDHnj; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=D7IdwDVL; 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="ZD7hDHnj"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="D7IdwDVL" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754977154; 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=5qZ9MFGSNnbL4P8AdyY5Ik7ybFfv9o7yHGW2eLboNJw=; b=ZD7hDHnjZMOIm00yOQfqgAKDUFMXLm6dY4+MWqvhp/2hNjYIzyK7fKxF+OxB8Dhw7T+aWd sxcq9P6OmcppL1kytpTFX8p29fPjYUMj+Lf2xu0ttZcYv9ia5MdpmLVuY0Zo4uPzw2U2G6 6u5L5VpivGWY5Yyr8omImqpWUYjun4IrWpVXWZe1nrThnHELX2n+Af78cquNexuKF/rn6J PVY2oDfnqN+7CIDy4yWEty3GMN6Y89fZ7+LhZDSkOW1lnOeoJ+Qyx+on2aLzfGsoFhgDQr l5wtNRvr/vchHE17EbQYDKvp7Wt4cxC2U2QyjKq+4mYHA6DNKur3lMqbrhidbQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754977154; 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=5qZ9MFGSNnbL4P8AdyY5Ik7ybFfv9o7yHGW2eLboNJw=; b=D7IdwDVLJ17shv1oM3ZQyiBryy/29fwOEhXTO4TMsQCbLH1N0Z/pHpCXmrVj2DgJFIueB5 Jj9EQie0gcl2nRBg== Date: Tue, 12 Aug 2025 07:39:02 +0200 Subject: [PATCH v2 1/8] selftests: vDSO: fix -Wunitialized in powerpc VDSO_CALL() wrapper 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: <20250812-vdso-tests-fixes-v2-1-90f499dd35f8@linutronix.de> References: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> In-Reply-To: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Christophe Leroy , "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , kernel test robot X-Developer-Signature: v=1; a=ed25519-sha256; t=1754977153; l=2819; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=QrlHtet0JRu7nFXpAhs1+5+M+BKn0zdv3choxoyODIc=; b=6hS7C4wxnaTrYBbWrmH3kvLNURxJ61FT51N/WVlBUbAkXjn8DXQmvf14RLKWmDPOOESNP0F4r zMDuFxVVOMBBAGkYIHfd5zgNmpbj7A+W0fOcH68u2NC+Sgzex8STTf4 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The _rval register variable is meant to be an output operand of the asm statement but is instead used as input operand. clang 20.1 notices this and triggers -Wuninitialized warnings: tools/testing/selftests/timers/auxclock.c:154:10: error: variable '_rval' i= s uninitialized when used here [-Werror,-Wuninitialized] 154 | return VDSO_CALL(self->vdso_clock_gettime64, 2, clo= ckid, ts); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~ tools/testing/selftests/timers/../vDSO/vdso_call.h:59:10: note: expanded fr= om macro 'VDSO_CALL' 59 | : "r" (_rval) = \ | ^~~~~ tools/testing/selftests/timers/auxclock.c:154:10: note: variable '_rval' is= declared here tools/testing/selftests/timers/../vDSO/vdso_call.h:47:2: note: expanded fro= m macro 'VDSO_CALL' 47 | register long _rval asm ("r3"); = \ | ^ It seems the list of input and output operands have been switched around. However as the argument registers are not always initialized they can not be marked as pure inputs as that would trigger -Wuninitialized warnings. Adding _rval as another input and output operand does also not work as it would collide with the existing _r3 variable. Instead reuse _r3 for both the argument and the return value. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202506180223.BOOk5jDK-lkp@int= el.com/ Fixes: 6eda706a535c ("selftests: vDSO: fix the way vDSO functions are calle= d for powerpc") Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Christophe Leroy --- tools/testing/selftests/vDSO/vdso_call.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_call.h b/tools/testing/selft= ests/vDSO/vdso_call.h index bb237d771051bd4103367fc60b54b505b7586965..e7205584cbdca5e10c13c1e9425= d2023b02cda7f 100644 --- a/tools/testing/selftests/vDSO/vdso_call.h +++ b/tools/testing/selftests/vDSO/vdso_call.h @@ -44,7 +44,6 @@ register long _r6 asm ("r6"); \ register long _r7 asm ("r7"); \ register long _r8 asm ("r8"); \ - register long _rval asm ("r3"); \ \ LOADARGS_##nr(fn, args); \ \ @@ -54,13 +53,13 @@ " bns+ 1f\n" \ " neg 3, 3\n" \ "1:" \ - : "+r" (_r0), "=3Dr" (_r3), "+r" (_r4), "+r" (_r5), \ + : "+r" (_r0), "+r" (_r3), "+r" (_r4), "+r" (_r5), \ "+r" (_r6), "+r" (_r7), "+r" (_r8) \ - : "r" (_rval) \ + : \ : "r9", "r10", "r11", "r12", "cr0", "cr1", "cr5", \ "cr6", "cr7", "xer", "lr", "ctr", "memory" \ ); \ - _rval; \ + _r3; \ }) =20 #else --=20 2.50.1 From nobody Sat Oct 4 22:35:27 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 E272E28C02D; Tue, 12 Aug 2025 05:39:16 +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=1754977158; cv=none; b=goGiGCD+GvVLZbNt9JnFafgtjThGigXH7FG0A2+wabWT2ZQ6s+hB4GwN7el7lFXc4ox8keVkD1dPsSTY3AiXGp8IOvuUYl20Cx0M2iI1h6jyMnt+Tg6B61clJGL4m3/qVdcw1ohZgKwJ10fnL7qPpWPM2EGtaSMTgZdC+//rvQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754977158; c=relaxed/simple; bh=8lskH1ggdxOTGceff2aWifYwOuKr4MYSx00pX1x86TE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kWqHgwoxNVKoa4C9BcLZOxJ+enAY0c7kADTG8BOIIwaA/w2uDk59lwoVEw4KTeb9S5RTfcj/7tzqENkqQoTm2UGa9bnGM0NfMBbMtk0/82xasSkFW1K8ZugZ9+c4YpieAEBBMeAN1yj7e8xJpt4BQpg7T8eGIZdM6FFtCE5ChOQ= 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=F7+/UlEW; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=QTl4r/8i; 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="F7+/UlEW"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QTl4r/8i" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754977155; 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=Mv1iFUT91ndYeuayFYV7x2iCqw5t+n+5VIpTU5JYlu8=; b=F7+/UlEW8X8cC1ALL7KCLNIaf+EjzwbtAx9N2PkTvefaLBmg2EeiqkdN0cjqk3+zCW56o6 FwLNsd1hEg1zxzuY9v0Y5C7k8hQo3hQt/eZLZjdRTdQUb3OSDe2fQojg/zGWCQSsfvrGpW 0U2Dj8uSWRFqXUZYbOUJQm/I1em7VjqNEr5NlWhHVCww+MMEPmoqGBS4Ywc9qQDHliarug pINb6VWodiiTVBlLTJl96XOObQ1nhd7HcGn7/LrIxBzG94qw430eepPWSbkbzE8BATwE7j IzjvAWNmMBoafAVRvMdTqio4kX36j6TKm6RxWpE40AVuiijmR79AYFcPjxAh5w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754977155; 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=Mv1iFUT91ndYeuayFYV7x2iCqw5t+n+5VIpTU5JYlu8=; b=QTl4r/8iwxQyyaXvHd4QHYJiihQ73Ax3H6L4TjlRNYJVTtzz3mk/7S+Iyo5qtDNohGJarX Mog1lCDbsD9u/3Cg== Date: Tue, 12 Aug 2025 07:39:03 +0200 Subject: [PATCH v2 2/8] selftests: vDSO: vdso_test_abi: Correctly skip whole test with missing vDSO 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: <20250812-vdso-tests-fixes-v2-2-90f499dd35f8@linutronix.de> References: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> In-Reply-To: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Christophe Leroy , "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754977153; l=1530; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=8lskH1ggdxOTGceff2aWifYwOuKr4MYSx00pX1x86TE=; b=xS2HDl+yZC3NMqHDtz/fe6u3lkQhR/SJQAw0PBD2gQi6SelYB+gY8aj9Cm62UnOyMwYkPHk+j mcLxpRtqio5CzeMhQ88+0/PzFeD2LLFyYGAHnGVCYrcgRkZfzTwuRQl X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= If AT_SYSINFO_EHDR is missing the whole test needs to be skipped. Currently this results in the following output: TAP version 13 1..16 # AT_SYSINFO_EHDR is not present! This output is incorrect, as "1..16" still requires the subtest lines to be printed, which isn't done however. Switch to the correct skipping functions, so the output now correctly indicates that no subtests are being run: TAP version 13 1..0 # SKIP AT_SYSINFO_EHDR is not present! Fixes: 693f5ca08ca0 ("kselftest: Extend vDSO selftest") Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_abi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/s= elftests/vDSO/vdso_test_abi.c index a54424e2336f4597e67668052b62cd7d6c0531ff..67cbfc56e4e1b0edce50d37ae14= 5a054e304892a 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -182,12 +182,11 @@ int main(int argc, char **argv) unsigned long sysinfo_ehdr =3D getauxval(AT_SYSINFO_EHDR); =20 ksft_print_header(); - ksft_set_plan(VDSO_TEST_PLAN); =20 - if (!sysinfo_ehdr) { - ksft_print_msg("AT_SYSINFO_EHDR is not present!\n"); - return KSFT_SKIP; - } + if (!sysinfo_ehdr) + ksft_exit_skip("AT_SYSINFO_EHDR is not present!\n"); + + ksft_set_plan(VDSO_TEST_PLAN); =20 version =3D versions[VDSO_VERSION]; name =3D (const char **)&names[VDSO_NAMES]; --=20 2.50.1 From nobody Sat Oct 4 22:35:27 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 97B7C29BD9A; Tue, 12 Aug 2025 05:39:17 +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=1754977159; cv=none; b=dVOcey6g82Kc2xZi37nZSkP55f5jm6WVr5/Kns1M8rYBotukjf9vLJ2xXzJ/ZbdsGoF98VO36gcjtbeLoI5j4KwXnkyTrp9ItguqLYmRbAYQhw5gE8/H8eJq+P1ofxSgQjo5DxasbOPf1fXOvi/9uYZeyAskRcPlDs4qImKI+9c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754977159; c=relaxed/simple; bh=lMvy9mMPLigV58NneqZctebN68FvSQ2op4StQi+D6+E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iwqxKON/pnY4TCFWKkZzQ5g1+l/DlJiYONECFfYUHdt5glBiqpNA3j5VWUkPVuHcfaf1CuzTxjWFiBA33o5WkZ64t9Ql2rUMwpLoAIZV9rokkAoLPX+2qxQ1wPOMdcwmsceQOIKzKo3lzgswDS+nt+fx0DiNi61Ykac0sKCrT08= 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=4kmQJnX4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3q2OxSex; 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="4kmQJnX4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3q2OxSex" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754977156; 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=xp075UorUyCKambMQFG4NnP9kfsQ1yKOIo2P32aHiEE=; b=4kmQJnX4iqNnAk3etQNIjKPcZLG+lYQD5nwEnmMYeHCMTCensgl/YOrd6CqQGTTy5KZBnj E9R3dKxPQcU4zUQ2prbQFwI1GAI6ebXHE/k6v2w/AoO2MvXinaOcfVm00WZDi20jLYNULi YG5xlCdLdEu61WormRTZhklYw6qAdn51zEs1EpCRVmauVsjwf+MbDnjRrJ99kgvRPKPEog r7S2w0MwmKngIkGy5Xdur4hbgKh30YJOoisSn9Srn8GSwTzNG9NhP4khsUsrSBew2tlzwG wanl2iVjTRys1HXflbcjUZCu6a+g41dLWtA78SEVn0hTV0uCiyC7zVRN1/DsQA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754977156; 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=xp075UorUyCKambMQFG4NnP9kfsQ1yKOIo2P32aHiEE=; b=3q2OxSexCawFa7Rw+Zhbi7N0KnXGrG1uMWRJLNAGpOdnvX6V1Z2pq/MbgiOM1L3CPNPKo3 6s43HKNMLxaMvZCQ== Date: Tue, 12 Aug 2025 07:39:04 +0200 Subject: [PATCH v2 3/8] 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: <20250812-vdso-tests-fixes-v2-3-90f499dd35f8@linutronix.de> References: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> In-Reply-To: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Christophe Leroy , "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754977153; l=781; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=lMvy9mMPLigV58NneqZctebN68FvSQ2op4StQi+D6+E=; b=cJTN0KcIPZ1MTyBCAO2az+bCeFUJejhDBlgM8cdz8Z7SLpkhqL+8E5kIR58vJieGjEaHgUZW7 uCvEtrIVk5FDKyReBy+j1OisgxfQZ6Pg47LpE2feS/4Aro2K1sSbXIg 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 67cbfc56e4e1b0edce50d37ae145a054e304892a..b989167ec2472d1f8369e61f13e= 535b15545a6bb 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -231,6 +231,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.1 From nobody Sat Oct 4 22:35:27 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 046DF29BDB7; Tue, 12 Aug 2025 05:39:17 +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=1754977159; cv=none; b=VXGEU3qSpBh/wUy3gGtUuAS3+Pg3yQ09UPugEbFGzVJIIuQzr3Butu3hwx+wNSI4U3+y98hPGCCnIRg+6wQzwcAu2wl1m/kwJvLHFLNSqL4b2h6PZLwZginLl+Kq1xk80ikYV2VlNpzQjA45KvJQYFBZ3OOnhOTwxnrs0FYuRhs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754977159; c=relaxed/simple; bh=J0bffmDqkEMGTX9pKwA5xnPdITGXNbAONclySIKDmVQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IYEYIsgWaq4QU7tylduM5tD5w808dWYJJJ+2MgjTW8mdqfXGLskiY3SCZn0qL7Y8xp64RKc9aDNMNbZwITfRh4h/Pfny84H2K+cBcIgtxYV9gDMv2ykA5S1bgwEV6QsmqIGjJeiEYYDd5ZLwLfLggfdYj+qhecaqpe/p9rSh0IY= 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=ph8giS6Q; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=91VBUxP7; 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="ph8giS6Q"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="91VBUxP7" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754977156; 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=7Bi/0fC1PsBoK0Krj0u4UUoMe1fRJ0GRKCtDeXVM6jo=; b=ph8giS6QiZ/g1Jc2pJgEb1J88lEnlFofe26W1IqKH/yRWeJ7Dct9F1wDBeWslH7lnhlLgq ycGsHIEZsnzbREHb3EK6s53dUV670sFW2Uzkthl93V92QH09eEk8Yrqihq0cvZ3WyaR4qP NFlJekL8WI38L6gBpqtD279Lzc0raH+yTPmH5c0lrzj6o1ZjHGpEe2hv4yqyeSsjREUWme usvWnXL/akkNJUCJwu3FChdT5LypE17IuyA4zYC/qUE//MpquH1pBpA08jhGMXXpH7dF5O WGYlw5qCKh/jcZIHyQtnEuQI2UmX8Akp4EJ0gHL7iCVDViUiLQZwtLfq0sJ59Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754977156; 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=7Bi/0fC1PsBoK0Krj0u4UUoMe1fRJ0GRKCtDeXVM6jo=; b=91VBUxP7kOS8yQar6MM1BVHCFItfA9c4g+27p7cMzCL0hZhKvOj7rEEzRBLFoek07Eh3pT 8FzchbV3UyBzIcBw== Date: Tue, 12 Aug 2025 07:39:05 +0200 Subject: [PATCH v2 4/8] 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: <20250812-vdso-tests-fixes-v2-4-90f499dd35f8@linutronix.de> References: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> In-Reply-To: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Christophe Leroy , "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754977153; l=1518; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=J0bffmDqkEMGTX9pKwA5xnPdITGXNbAONclySIKDmVQ=; b=x8Z9x79c65WSj2apRZpCIMt6A48hc7Z6bjzPYMu5AfTiLXLVgF7KRyzHTUH3105eGaX4v/14J BQtnXwnTp+lAVBfgeM7vwqeDMaNBFswNeW2NZwOzeqDZupPiKkAXA7J 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 b989167ec2472d1f8369e61f13e535b15545a6bb..d236dd8305e1e3f41df07e0b7ff= d5cfe8aebf826 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -197,37 +197,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.1 From nobody Sat Oct 4 22:35:27 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 12B6C2D660E; Tue, 12 Aug 2025 05:39:18 +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=1754977161; cv=none; b=BpWJJC2asWxtoNEKiXmu6CKMZNkDFaXUBqBA5n1eLJOrdtVQnzaT+qmWK5rupxijD2kWQx7dk9ZQhlFQwzJbhasCPAsbb6XwvNXhw53vvvB3hRy4s9A8V0BCPyQRI11OMZYAN9YAMUzRHZPn7IR+woINjvdD+/dfSICwtaKMhGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754977161; c=relaxed/simple; bh=zoESJI2UttEP3Pjk/yC1msAGnta0GQeqnqMfkXNXEnw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GLMxlStP4utc1X8iY89ZtA6ABpq/YuObBso16Ih/uyBvM9cK7XruO7FcKAKWssiTfTr9oy8mC4M4ogDDqT3W/o6Ep4RohLt8eh2TplTMUWg+teXi60C+Vep94WFecey8+zc4orbotcENq6JcTI8LYqpor2xVAfy7Ydjy/LCasEk= 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=rJqyebqm; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=SdZtvLcd; 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="rJqyebqm"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="SdZtvLcd" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754977157; 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=NY5A9v6rK026eOqjEvmx1Em9+y80kflzRXRJav0ND5g=; b=rJqyebqmc9RyV7bjLidgXnCExpvAwy2tcnfSyZstwkxg5EcIMba9QQBwAoC/QSj3TNn2Sh ycU3XeIpWF/omCbxxPV7FsPfaEjb/pemUH4RgW5qEKInzgc/m955p4KiepkmIamO2ekTgc 1wVy21x/9wzMvbu6RYXGLlr5yTIyGfArmvruvpcvuBUYCQRXNcGsclYCXtt02pOQK2NBoo EJArNmgCRLYNgw4Vpir1L6V6jjsnwXQMP+8QVm88ydpqkZFKNSm0gQEIpTgjL9784nsDR1 /GZIRgawFXPkwFkuGX18kwY4a6sxQ9W0ImPyCdyExgFytfqy6EJWAg7Vur3jGA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754977157; 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=NY5A9v6rK026eOqjEvmx1Em9+y80kflzRXRJav0ND5g=; b=SdZtvLcdLnwhc/upJ6vhr+eJIa9IYQ+Gk+cGt5UEw5nrwXYqw0JUyZ4tb55LHW3DmI9o9R ffqEXjkMBOOUCVDQ== Date: Tue, 12 Aug 2025 07:39:06 +0200 Subject: [PATCH v2 5/8] 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: <20250812-vdso-tests-fixes-v2-5-90f499dd35f8@linutronix.de> References: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> In-Reply-To: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Christophe Leroy , "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754977153; l=2009; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=zoESJI2UttEP3Pjk/yC1msAGnta0GQeqnqMfkXNXEnw=; b=7NduNBC3L4bmAv9iUOvgwh4bjBGnEkDmbuhUA7z7Jf3jj+WvNN/hZ00Bc9odVHcZlvVObQvFO LhTsKd/ZVXyAWuT4jh9DR7XbSkaTUWcy5FTxCOQmPOSupc1dgwRSnwL 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 d236dd8305e1e3f41df07e0b7ffd5cfe8aebf826..a9a65f0deef3c32a96d79076201= 84ca541a3637d 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", + [10 /* CLOCK_SGI_CYCLE */] =3D "CLOCK_SGI_CYCLE", + [CLOCK_TAI] =3D "CLOCK_TAI", }; =20 static void vdso_test_gettimeofday(void) --=20 2.50.1 From nobody Sat Oct 4 22:35:27 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 12A872D47E5; Tue, 12 Aug 2025 05:39:18 +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=1754977160; cv=none; b=ELpuzqTZdL1yhd7QnekmlkJBJpC6MYoN1r26Kpi3/ynOqCUeT+IC7syHFrERuAQ3SVBEdrarL7yvyvhqQyF5Ak9r5NSyfRbZ4tfQVGfodGV6tmJ0YkO9ePqRTYa4unXu/wXCks1NnuxHf+RBKMPhFvPl5KBE/A82znniDcHr5ps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754977160; c=relaxed/simple; bh=K56opDZHFYSNalGoHUaS1vVkhdYzFI8w3ybfyYaVbnM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=e3GPW1UiYjPFJ2rh82CjANMxQJwCQ60T0di+aWdrKqDPVTqB71vGQVpBQ9n9ZSIHT0FZ3slWeGBEj1/5dtiSCeP9CwXxp1hXCFPtvil95JrMLw9m1VqfFZco3gtRlYYgDQHklT5WdNGevVU7FMrbd4s3Z074gkpB6FH+rYBjDi0= 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=R2Kuz0Qb; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=/S7HZknm; 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="R2Kuz0Qb"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="/S7HZknm" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754977157; 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=0qr3YJTIIHkQldQtaaXfRCHhn5q0x5oDQoZfMKXfyLg=; b=R2Kuz0QbEP7xQ+Y+A7oE8zG/Z3JXMYLiezPd8ueabSeTDmDtldGyhhlQUV9is2G71G3EKF RuPNCRbwynhRgRhQzyv4kNj+EKiB3SzBVAKWY3YUvVYNe1GhIldBuZOqpQ8kXOToQgICPE 9l2EA1hAW5FCuPSfQp8pUMNdCtsFx0HphimfCMIVyXaUULiFQNKvGaEthpQ/1SxDTrkHLa tB5kDOcunSNlEpmwXiUusXK3CJlmhv0GosFmaeq17BX5u8qpwQpEEcMOzYys02duKMEnXl N4PtiwEWDgEK9WIkGs91le/Bagyn+rcqdN40EcxIIC03d0cmGqGVqDJAoTL5UQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754977157; 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=0qr3YJTIIHkQldQtaaXfRCHhn5q0x5oDQoZfMKXfyLg=; b=/S7HZknmW+r0UJlmIA+ixcYXOSFzxaAeA7l+uTT+gl6ZmiBaRUDC+XEEWd1jkdm36eN0Fy Xf56ab+IF68Rc6AQ== Date: Tue, 12 Aug 2025 07:39:07 +0200 Subject: [PATCH v2 6/8] 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: <20250812-vdso-tests-fixes-v2-6-90f499dd35f8@linutronix.de> References: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> In-Reply-To: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Christophe Leroy , "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754977153; l=1088; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=K56opDZHFYSNalGoHUaS1vVkhdYzFI8w3ybfyYaVbnM=; b=1yZnd6TcHqnA2KlV/7VcSuMkTs940bRUJhjzbqmcYyDq+J4QEmrOVbmadcbykOypxabwtHyWP dcE+W+aSS4PAdvAgPTbQKip+19QtLy6N8gHIikkeu8JgLda9ZkSWpCt X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The structure is already there anyways, so test the CPUTIME clocks, too. 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 a9a65f0deef3c32a96d7907620184ca541a3637d..c25f09998b82d797d690228e6ff= 026150b28934b 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) { @@ -204,6 +204,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.1 From nobody Sat Oct 4 22:35:27 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 6EC4C2E2DCE; Tue, 12 Aug 2025 05:39:19 +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=1754977162; cv=none; b=iV+c5KhjZIfRDwwLmsMoyVqR96R2jU3o9rNYIhPye4WC64GoZbcCynpcwrYbsrJbjIy1WihTDkyCJRvEdjPZdtRgWFc7H9qVuLENDDQ8adt9iA2sZ0cHNIDFiTcOMmOPXrPQtRqW29pP2bH++ZTuOBMpdRnO+dLB6WYvoyCGoh4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754977162; c=relaxed/simple; bh=462tCF8mGJkETKI+jaYejyOhp0vStB6ZJ8kzTN4Bmx4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SMZt/t2UcuB0lDj4M3euNvllcSOb8pLRIMMbrxDgzgX8VXawsIQ2ksadrVPNyVsO/QlvzKr+Xgj+wXR+An+RJX1zFAuGZY5s9xffBssIydVAA5xtNflXk6r2+7anlxCrOMfO0wMLYhv1iSa+adrlJhreG7DVSxyanBMZCx2zu0E= 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=YPlqT3b8; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=m1IHNB2+; 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="YPlqT3b8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="m1IHNB2+" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754977158; 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=paqhkyGhSs/0Q/CzUgBgb/bsN6VDHUKBy2HuF8Oujz8=; b=YPlqT3b8aj1negDGz7pRTRww70zM1R5ouhChTTv+YbAhIqlL2zxn7IK5JKg/sjuPUDQHC9 4dyIVJy3ZInIO8vKSG2GYRQ6GG1lDdjx3n3LeqXlHu4MjaJJxBrF4xvw0LVQNTjkNzTNmQ PX+gHvmATjoUQyFfJKl6Euuu9zONYzLyWmCSsIGdzy59C9UPFfpoRnFnpdWppmPREUeVfm 7Y28yZQSoHEUmg7AHThaZHwufNgzcLQerg+9T7yZvlIkPtkGH1I/sMbLIHBD2xF38Hnp/n /qpAEzQIwmcXntEZSk2L6LM9EHyxXNEj/3JyQB/+PHUcJB3rDrSrY8tdaoxZsw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754977158; 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=paqhkyGhSs/0Q/CzUgBgb/bsN6VDHUKBy2HuF8Oujz8=; b=m1IHNB2+Vw5ZMoTUEGwVtw9hrhGgqXUeCduGcYJHWepCE9iqXF6/jPqd0sos5weJrpq6iv 9m7NKQkI1QicqxBw== Date: Tue, 12 Aug 2025 07:39:08 +0200 Subject: [PATCH v2 7/8] selftests: vDSO: vdso_test_abi: Add tests for clock_gettime64() 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: <20250812-vdso-tests-fixes-v2-7-90f499dd35f8@linutronix.de> References: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> In-Reply-To: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Christophe Leroy , "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754977153; l=2655; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=462tCF8mGJkETKI+jaYejyOhp0vStB6ZJ8kzTN4Bmx4=; b=AQdP8rsPJECo0A3Z6uyyF1sHmWxvKFwKCrLTo7LfLKc/o8QDHcZs0jlxk/NywoSEv1KHC2mYC +6qbaoALPbVBX2YxA1uYhV/8aw7htvFfsewHGuUTbVp2gobY64XGOP8 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= To be y2038-safe, 32-bit userspace needs to explicitly call the 64-bit safe time APIs. For this the 32-bit vDSOs contains a clock_gettime() variant which always uses 64-bit time types. Also test this vDSO function. Signed-off-by: Thomas Wei=C3=9Fschuh --- tools/testing/selftests/vDSO/vdso_test_abi.c | 37 ++++++++++++++++++++++++= +++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/s= elftests/vDSO/vdso_test_abi.c index c25f09998b82d797d690228e6ff026150b28934b..238d609a457a281d802734b40d6= a2c35ba7f6d72 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -26,8 +26,15 @@ static const char *version; static const char **name; =20 +/* The same as struct __kernel_timespec */ +struct vdso_timespec64 { + uint64_t tv_sec; + uint64_t tv_nsec; +}; + typedef long (*vdso_gettimeofday_t)(struct timeval *tv, struct timezone *t= z); typedef long (*vdso_clock_gettime_t)(clockid_t clk_id, struct timespec *ts= ); +typedef long (*vdso_clock_gettime64_t)(clockid_t clk_id, struct vdso_times= pec64 *ts); typedef long (*vdso_clock_getres_t)(clockid_t clk_id, struct timespec *ts); typedef time_t (*vdso_time_t)(time_t *t); =20 @@ -70,6 +77,33 @@ static void vdso_test_gettimeofday(void) } } =20 +static void vdso_test_clock_gettime64(clockid_t clk_id) +{ + /* Find clock_gettime64. */ + vdso_clock_gettime64_t vdso_clock_gettime64 =3D + (vdso_clock_gettime64_t)vdso_sym(version, name[5]); + + if (!vdso_clock_gettime64) { + ksft_print_msg("Couldn't find %s\n", name[5]); + ksft_test_result_skip("%s %s\n", name[5], + vdso_clock_name[clk_id]); + return; + } + + struct vdso_timespec64 ts; + long ret =3D VDSO_CALL(vdso_clock_gettime64, 2, clk_id, &ts); + + if (ret =3D=3D 0) { + ksft_print_msg("The time is %lld.%06lld\n", + (long long)ts.tv_sec, (long long)ts.tv_nsec); + ksft_test_result_pass("%s %s\n", name[5], + vdso_clock_name[clk_id]); + } else { + ksft_test_result_fail("%s %s\n", name[5], + vdso_clock_name[clk_id]); + } +} + static void vdso_test_clock_gettime(clockid_t clk_id) { /* Find clock_gettime. */ @@ -171,11 +205,12 @@ static inline void vdso_test_clock(clockid_t clock_id) ksft_print_msg("clock_id: %s\n", vdso_clock_name[clock_id]); =20 vdso_test_clock_gettime(clock_id); + vdso_test_clock_gettime64(clock_id); =20 vdso_test_clock_getres(clock_id); } =20 -#define VDSO_TEST_PLAN 20 +#define VDSO_TEST_PLAN 29 =20 int main(int argc, char **argv) { --=20 2.50.1 From nobody Sat Oct 4 22:35:27 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 359692E2835; Tue, 12 Aug 2025 05:39:20 +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=1754977162; cv=none; b=UH1ddt3Mhqthm298CV3dFbIcP+he2dls91gNke5v6Zr1i9QSVj2J2lPZ+HUSYpDe4xKYmqHXJdG0kF3CT45T8gc9nJhrCSnpHhyUVrfIEY3sxK+OdTYv9TRZZjtuJcdsWLD2ousCw0SanpDI6+iZOoA79OQEHOXLTl4K8VZXjwk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754977162; c=relaxed/simple; bh=02daXCIbkRjNKoy/vay068lu47laZjYbudY0loa/xcc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Uud8h5tXazocJXjMgrS9xpxwoze6vTZd+mrTpSfPin7Qbge1+Pr5FptjqEzSAS9G6SyPxLaih8cxmzZ64WES5VDJxQztTq+C6RiWX89yV2hAMPAkX2/NORW1uc/oEOV0Cxk1IdwaICySI0emeT53tHaDaS3F6hJlaA3sKQfcm0o= 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=19LHLuI6; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=bzX/yQmT; 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="19LHLuI6"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bzX/yQmT" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1754977158; 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=UoV3x/XJg/ANc0lHinJVW2aC441y0iz7f+A5Ef+AT6Q=; b=19LHLuI6tVonRzXepH1HJoekuFoQ2pUv7xdk+UeMQ+IUWxe0Q1RHQiPZPnPxh7RekdxT6L 7xChZISs5PoaJfDrUXX/xyGi4LUS7IW4giJ6gozkJXZsImFU67C57ycgTn8broAia8wA3r SjBWRvOC6d8YDG/KlGaPeLgQM0z4u8EWomg4xoJAqrH0ku6dLd6fCF7RjtrVkMktWsjiZs XsDXCwQCWweq/yTjNTdqqASgJLwA2mQbbRX0UT/+1vt8ZJ2sHpAq5saLCwz0AACm6HwiVR fmu/FwwbSPB8hZZfCNeTd8Mo/WESjwSUqDrvqZCKXB2Dxm8gGps2QOezEwzmCQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1754977158; 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=UoV3x/XJg/ANc0lHinJVW2aC441y0iz7f+A5Ef+AT6Q=; b=bzX/yQmTGgcj7BYfGJJqCJo1Xh2OAJVyxJ5gjsJ6m4kUa7fXmrbzkadySm8CniqOBtZp9a EnLmUhD++kdHDkBQ== Date: Tue, 12 Aug 2025 07:39:09 +0200 Subject: [PATCH v2 8/8] 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: <20250812-vdso-tests-fixes-v2-8-90f499dd35f8@linutronix.de> References: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> In-Reply-To: <20250812-vdso-tests-fixes-v2-0-90f499dd35f8@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Christophe Leroy , "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Shuah Khan , llvm@lists.linux.dev, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1754977153; l=5188; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=02daXCIbkRjNKoy/vay068lu47laZjYbudY0loa/xcc=; b=r7ieb+PVA8N9MszaJgXwJQj2Si1r3jimKm+R3hw8TlT82AZpsq/nx10e6uUqW3++1ihCS8/oy NS+KZ7MKu/9A3DIdaeuv2bJ4K/maWONWHEqj2S5rc/V4asG2vnBfLR3 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/.gitignore | 1 - tools/testing/selftests/vDSO/Makefile | 2 - .../selftests/vDSO/vdso_test_clock_getres.c | 123 -----------------= ---- 3 files changed, 126 deletions(-) diff --git a/tools/testing/selftests/vDSO/.gitignore b/tools/testing/selfte= sts/vDSO/.gitignore index 30d5c8f0e5c7dfe9a330e440801aeac7e19faea9..ba322a353aff14eb3e951294e36= 04378eec2b14c 100644 --- a/tools/testing/selftests/vDSO/.gitignore +++ b/tools/testing/selftests/vDSO/.gitignore @@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only vdso_test vdso_test_abi -vdso_test_clock_getres vdso_test_correctness vdso_test_gettimeofday vdso_test_getcpu 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.1