From patchwork Mon May 5 09:19:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 887675 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 918F51F5433; Mon, 5 May 2025 09:19:51 +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=1746436793; cv=none; b=kH8pyc7x1/P+Nxt+WRQBVBmbQ5e3NAwxNSjem32RH9cbukYHsAGLLW/om6JaoRtpEBRZMSPu8I/RBYKCOpxMWx8luVWx9lyCFGn0yuOt80wNU9E2ut5V8PvOH4Y71I4MNhVV/RgNV6lSiFW3+xlF1k1/9Ag9YSee1wKaomCDbio= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746436793; c=relaxed/simple; bh=L0qtb8FJX1isKiB/PbWpoGiF8bcQshhPPSDSunRZq94=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pQQBbvEkzl2ysiGPqxZ8OyWsP/GuDbZMl/hw+sEoAfk2VbH2eCZ52qJaZzqCnZr/RMpunfc78ZbSsD4aHmrLvx3nh8bKIRoNs4qew7uRFuwWtpAlD8ig1Ze3JejvQ+RexL2ASr0soUd/g/qtI655v6b8Ej7fqMwEaDwaMmeddPk= 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=ga3PX421; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=NKuxbvK0; 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="ga3PX421"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NKuxbvK0" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1746436789; 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=DgzEmy6Q/OWuk6h5GBXCorQ/DWv5dXNm4qfWcJTsUEM=; b=ga3PX4214yJOjA1oE6cadQRo9roRPQ1dQsX4Temp9hdiAw3w+FyYNAiSeuvwHI6V2twFlQ +Zq7WMzhCspfdBmuEJxxn3x0WZ/g3KxFIm6HgMzXNcoE3hzmsnGYaauPR/iG1ON9CZXSTd R5vdBBHpj0Dw5fiL5Jh308Y/w6q+JDjblkyt+B6z1MsrZ40ra9m7L6pveQywmF0y7Iv4hB SU3f22coWecuItvhBVITu6NsfjLBni2SX1l46iI9L71PGMs9LEIeD9TprDXZQz9baOHQWM 8DsQph8mwhmyOs+Rw5rTbbHPKalVYpS/R54l7diHd5TM0vj8acqYIN6dpOJSDw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1746436789; 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=DgzEmy6Q/OWuk6h5GBXCorQ/DWv5dXNm4qfWcJTsUEM=; b=NKuxbvK0qchEJJAfzHnhr23oXmSpWAC30kXYC6AsRiewqw7A3JY5Ar7MKqaDnG0L6QMGyC rzN773bRgEzSbtBg== Date: Mon, 05 May 2025 11:19:35 +0200 Subject: [PATCH v2 1/8] selftests: vDSO: chacha: Correctly skip test if necessary Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250505-selftests-vdso-fixes-v2-1-3bc86e42f242@linutronix.de> References: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> In-Reply-To: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , "Jason A. Donenfeld" Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Muhammad Usama Anjum , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1746436782; l=1694; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=L0qtb8FJX1isKiB/PbWpoGiF8bcQshhPPSDSunRZq94=; b=VqBVuEdHNX+xVFE37iyRluGy6vP1s5OQjCVbfmN3k+lsEW38M50WMFYO9T/K7z75uCSIEwjs2 LZBNCmlJsiKAff6LmqwRfyKTCQcGmELOpaNxRzKOfrQsLgIjfPNRKLH X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= According to kselftest.h ksft_exit_skip() is not meant to be called when a plan has already been printed. Use the recommended function ksft_test_result_skip(). This fixes a bug, where the TAP output would be invalid when skipping: TAP version 13 1..1 ok 2 # SKIP Not implemented on architecture The SKIP line should start with "ok 1" as the plan only contains one test. Fixes: 3b5992eaf730 ("selftests: vDSO: unconditionally build chacha test") Reviewed-by: Muhammad Usama Anjum Signed-off-by: Thomas Weißschuh --- I'm not sure if this is not a general bug in ksft_exit_skip(). First ksft_xskip is incremented then read back through ksft_test_num() and then that result is incremented again. In any case, using the correct function is better. --- tools/testing/selftests/vDSO/vdso_test_chacha.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_chacha.c b/tools/testing/selftests/vDSO/vdso_test_chacha.c index 8757f738b0b1a76a48c83c5e5df79925a30c1bc7..0aad682b12c8836efabb49a65a47cf87466891a3 100644 --- a/tools/testing/selftests/vDSO/vdso_test_chacha.c +++ b/tools/testing/selftests/vDSO/vdso_test_chacha.c @@ -76,7 +76,8 @@ static void reference_chacha20_blocks(uint8_t *dst_bytes, const uint32_t *key, u void __weak __arch_chacha20_blocks_nostack(uint8_t *dst_bytes, const uint32_t *key, uint32_t *counter, size_t nblocks) { - ksft_exit_skip("Not implemented on architecture\n"); + ksft_test_result_skip("Not implemented on architecture\n"); + ksft_finished(); } int main(int argc, char *argv[]) From patchwork Mon May 5 09:19:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 888381 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 794911F5849; Mon, 5 May 2025 09:19:52 +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=1746436793; cv=none; b=bwvPku+gw51UE83QHUB/d362RIu2/6FIOvm1Lc3ywTOXJs7Q31shqYt+sWU9RVTNhOE8oqzj6cmbghjQntlose373iTvRrtmN1eiPCxMLUNSs8dGz0zfkKWVlZ6q2dm/HXCejpZxA3tMyEuqK+0Vyq7zQ0CRyA9ZtM4o5lVf2hc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746436793; c=relaxed/simple; bh=J9hKPnnc2A0cweqLzbgQ20+H2ZBdLzJrRKeSWwaEXh8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=McI/eGdRdK4uJWxRpuh0HuGaCVAo35M1oWYNvYbUQk518gAGyFm2CezMEco9WKQPO1t2irTcXLnTfX6ltENImCkZ1cRqUYx7gUYEUIhBzjMRFvBwCGcmS00XH5R0Sfb/c2vglRqf0vf7euPgL6ibLWRafEvMwe0Jn8EC+tKWX4w= 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=P9XeLr8g; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wpxsbT6A; 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="P9XeLr8g"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wpxsbT6A" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1746436790; 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=Z70zMxE+h3XzbWkN3rpdJuxDTk7yXimHYHKQ9cAetLs=; b=P9XeLr8gVGDGxkzlOCm2R7utGhoHE68eF9WmTpD7UfFiBq3WwhuKxC5utB1JkpBAf0ikwp ETkWD0QdicZexAgjIglP7cQMcc77m411+4Fpc2rDbLoSj66JdB3Tq4OsxIjpdBmLCvfYTd OV1G3o2veuJ0Og3KryT6W/hyndhD5cCDKYLgQKtfJsEmvzbFmik9kbg0C43UnQ2okuUCIu qIOiI945w0XsoaWF5bd3lPypPwof7aP2cK4/5yHz2tpq20IGNvuEHqhZiypLtT7zCJtUdH 8tyQLLSPJS5ymhBaIIoO3zWIOfh3IiQZVEkOoHWz+Vry/YL/ofIO+1aAMJQVLQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1746436790; 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=Z70zMxE+h3XzbWkN3rpdJuxDTk7yXimHYHKQ9cAetLs=; b=wpxsbT6AqMsIuSckCafDfsI4oW14R7JwykteIvnuvogcnQC9iJbI+8QIK6DRa+UjBD+1Gm 80x296ecD3d6x5AQ== Date: Mon, 05 May 2025 11:19:36 +0200 Subject: [PATCH v2 2/8] selftests: vDSO: clock_getres: Drop unused include of err.h Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250505-selftests-vdso-fixes-v2-2-3bc86e42f242@linutronix.de> References: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> In-Reply-To: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , "Jason A. Donenfeld" Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Muhammad Usama Anjum , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1746436782; l=788; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=J9hKPnnc2A0cweqLzbgQ20+H2ZBdLzJrRKeSWwaEXh8=; b=lMdwDzQC4zbF2jZyog/m9ojphWYBpipNryaQDBfFSqfhbJdx7Q2ehlxsX5fIL5U5ZL5mkRX1e y3gSGl55j+yAIObWSLoVMLyvwkwydlw6/elbSu38Mt37l1SwKVtkrAr X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Nothing from err.h is used. Drop the include. Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/vDSO/vdso_test_clock_getres.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_clock_getres.c b/tools/testing/selftests/vDSO/vdso_test_clock_getres.c index 38d46a8bf7cba7a9b4a9b13b5eb17aa207972bd0..b5d5f59f725a703c357dfca91bfe170aaaeb42fa 100644 --- a/tools/testing/selftests/vDSO/vdso_test_clock_getres.c +++ b/tools/testing/selftests/vDSO/vdso_test_clock_getres.c @@ -13,7 +13,6 @@ #define _GNU_SOURCE #include -#include #include #include #include From patchwork Mon May 5 09:19:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 887674 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 61EAC1F7586; Mon, 5 May 2025 09:19:53 +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=1746436794; cv=none; b=r02j0bruDKlfql/rTVr/1x3ep0funN1ZFuaoA/1xj4KO92BuF9YnXwbL4rPXkCqOpaUM1ZHZiPBzj67dclmzJ8Ce5Pz2OPHNE60SVyQf7p1SgFGlfTLI6mBhcd5djtayvfAr+sRwhwrE2UOrDhD+heAtv7U4kH0uIDEjyH3MgpI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746436794; c=relaxed/simple; bh=Rqf9Ybql9mWv2FDqbi7vecIXl64pB64/atVfT6XP3fg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GiX7pQAwtnUf/VI7W+/JNSE9QC29n5PoNDa57pjArfBcdNbviNUqvFRn/jfIaBqNHJrtLl/cK9YlIc06bhD3iDHzgz7nAeNG+QwTfznzScZ1QS65NRFVKdhaFysHxsWzPBjGTY4/jkDHpJWh5mbr0/TFQK+r9btMBeSUDtV5Zek= 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=gJ+LVbf7; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=SmyHCK4J; 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="gJ+LVbf7"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="SmyHCK4J" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1746436791; 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=qQzNOCNFp/mc7w++e/8s7o1Kxroe/aW5+25iJWwhE3E=; b=gJ+LVbf7oVjqVIxN28UguKYRZy5gsN4PTBaLfqiZLNghjqTs6rUJrSGz4cAi0AmFhCmj8I q8FdiCil6GTQUc8UibjlMxPbxklH5qKBiDDBOtC76qk5f17zwytBMWHi796Ak+UWhDgBAY 5z4dIz1IGiCGh/wpK8b0sXSiB01UUH0/wJVyqJWuhVKkvd/CfxYJ1+ryEJUJBgHA63w3QK X38Gkgz9fXTRbQMODhGSVtIuQ/p/r+pGvEiypd6zeYQr6sRkLWLMW57I+SYaShd2gPmoJs kz4o1F3nTb/omLUwYI2Bwi8ypGNNa6q6K8kRbol/gNhremOCIONJzo3tJt2LlQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1746436791; 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=qQzNOCNFp/mc7w++e/8s7o1Kxroe/aW5+25iJWwhE3E=; b=SmyHCK4JS8nU6Qk8L/EHxW5WO2KklEtUpf4p0EQYcutP/MTxAaa/75KpZVldEx+kq43ZhU 94Pl2h9pvFdQ6/Aw== Date: Mon, 05 May 2025 11:19:37 +0200 Subject: [PATCH v2 3/8] selftests: vDSO: vdso_test_getrandom: Drop unused include of linux/compiler.h Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250505-selftests-vdso-fixes-v2-3-3bc86e42f242@linutronix.de> References: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> In-Reply-To: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , "Jason A. Donenfeld" Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Muhammad Usama Anjum , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1746436782; l=887; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Rqf9Ybql9mWv2FDqbi7vecIXl64pB64/atVfT6XP3fg=; b=Qt6gFL+jVwGqSxaUpQH0havWzM6CTtwT2AGxxO/ZVHmGuuVi9DYu8gEGMnTGGER9YxD7kWDU9 Ywd+42vYh8/A3Fbodv7vswQpkS1jMYlxu1KESeoMOUmmIygDU2LJwDO X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The header is unused. Furthermore this is not a real UAPI header, but only exists in tools/include/. This prevents building the selftest against real UAPI headers. Drop the include. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/vdso_test_getrandom.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_getrandom.c b/tools/testing/selftests/vDSO/vdso_test_getrandom.c index 95057f7567db22226d9cb09a667a56e387a33a46..f36e50f372f935e6d4da3175c81e210653bdce1d 100644 --- a/tools/testing/selftests/vDSO/vdso_test_getrandom.c +++ b/tools/testing/selftests/vDSO/vdso_test_getrandom.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include "../kselftest.h" From patchwork Mon May 5 09:19:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 887673 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 694AE1FBC91; Mon, 5 May 2025 09:19:54 +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=1746436798; cv=none; b=S9mJrKOZYJ7MgVGBcYzwmmuQX2JRlciXzB90JZKbD1rEO8fxJj4Nag0r19yfYe/oZsjdXR3/QuddYI25sllh2GzJNN5l4B2dyZSuxmZ/jYsrfa+deCFl9lqN/C31l4jp8EtO/gFENLZFgOKqTJK9qBDfTsWacLRMvpHBO3JchfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746436798; c=relaxed/simple; bh=cxHEGn3tPKliGKbaFKHQWUGc8P9QKk6Hye+vt7qgNJQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XGSh91iSyp4doKXIzYTWfsYEze9n84SkasZkYypUVlvWuUSqEq7omngVIy6r99ZPg4s0RTVGKEXzBxuUuHhvlhCkjeW8p96uFPnAOOvemjRHfENOUKAK7MECrV1LDyv/GK+jhpUdyQ/96k/EC/jSM3SRcnevAxaKS6jOq2CZmDo= 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=kcZthQrU; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=9KFB5+oL; 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="kcZthQrU"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="9KFB5+oL" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1746436792; 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=MDW0PZHCiGvBphD7V/nCe9wsSYuC9r/BQCQX6s4mLdY=; b=kcZthQrU9d6uBMs8/a8RX8teatYV0FprWtSSJG5BVD9nNeCMc5o2sChCoWmCHGyONaNudP 1zny02arA8AMm+oVLuzdgJmq2BO36ScBz5p2wJ0yq09SMsvWDh1602UF5XxV+JHL49kidj v59b94tNAoiBIw9nyToZUaK5Bg3AeOjHE9pqL/TASBzz6UDVMYScgkby+6laJ2NVpcbcXY f/erNHXtCDqeU6ioPHuyF2OK7XRT6P2fv7Gp4oK+u9sgqvOg7MHjxF6VwY0ndYyG+I/nd/ 9rkSsh4uWyfVHNVZAPQTX5rlrGE/uQkH2WTBywneHVF38H212xL4sbO91SuNoA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1746436792; 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=MDW0PZHCiGvBphD7V/nCe9wsSYuC9r/BQCQX6s4mLdY=; b=9KFB5+oLt9p3kFaN4qt+X7fdwde43rzsxEbaRqeggR58HBrVtfGHb7K1Fg04eH7UgtPpRV oQI1jbiH00zyhJAg== Date: Mon, 05 May 2025 11:19:38 +0200 Subject: [PATCH v2 4/8] selftests: vDSO: vdso_test_getrandom: Drop some dead code Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250505-selftests-vdso-fixes-v2-4-3bc86e42f242@linutronix.de> References: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> In-Reply-To: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , "Jason A. Donenfeld" Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Muhammad Usama Anjum , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1746436782; l=1351; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=cxHEGn3tPKliGKbaFKHQWUGc8P9QKk6Hye+vt7qgNJQ=; b=nY1AeZ1JVgGbFdV0OPa/+r9vqXD9H7Lgs97hD5C6DYCPe1814XVgRWgEAhSRVkjnRt6t8yiEf 0ksjvuWh6FCDCXX6wvR2oZsZDaRz6x4HfYFYgJRA52TGuUV/6M691m+ X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= vgetrandom_put_state() and the variable ret in kselftest() are never used. Drop the dead code. Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/vDSO/vdso_test_getrandom.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_getrandom.c b/tools/testing/selftests/vDSO/vdso_test_getrandom.c index f36e50f372f935e6d4da3175c81e210653bdce1d..b0e0d664508a38d6dde9df0a61ec8198ee928a17 100644 --- a/tools/testing/selftests/vDSO/vdso_test_getrandom.c +++ b/tools/testing/selftests/vDSO/vdso_test_getrandom.c @@ -100,15 +100,6 @@ static void *vgetrandom_get_state(void) return state; } -static void vgetrandom_put_state(void *state) -{ - if (!state) - return; - pthread_mutex_lock(&vgrnd.lock); - vgrnd.states[vgrnd.len++] = state; - pthread_mutex_unlock(&vgrnd.lock); -} - static void vgetrandom_init(void) { const char *version = versions[VDSO_VERSION]; @@ -264,7 +255,7 @@ static void kselftest(void) } for (;;) { struct ptrace_syscall_info info = { 0 }; - int status, ret; + int status; ksft_assert(waitpid(child, &status, 0) >= 0); if (WIFEXITED(status)) { ksft_assert(WEXITSTATUS(status) == 0); From patchwork Mon May 5 09:19:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 888380 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 694501FBC8D; Mon, 5 May 2025 09:19:55 +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=1746436796; cv=none; b=Hnb2tP5ovd7vr7CqbvCbzY5pyzqY6iCyM/F7Rc2md4WkhMc1dCME7HiDnHsuLCczFz1Z10W5DTaKl3jNMYZn5HPFfN1YgPKNd+ZMguTcGujRk8QjSJujp9YcMs5lT3DsiTwJS4itcfxA6vYDt7vIHz+g0LzIeDxgmXP5OUbup0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746436796; c=relaxed/simple; bh=Jd9bN1x0QUY5vumCRf0DJ1rTzHAMY7u+Dc+/Xk5jW5Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SjTFxxGPCR/K2DhI+VVm+XLqko6iYsnTeKYN/EOtiY3igL3Bis+hNB6aK5go0ArEVh7f/jUmoXKrA6qshkbs+P3yfqSBpz3JlwdomXo7Skyj5r7SyQvqp81BfebrPbMwUkwO8M6CebM0uEGqJ2pgsjdU5EErKYOnw9Mz2vtuiRs= 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=nvI5Swls; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zheezx5I; 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="nvI5Swls"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zheezx5I" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1746436793; 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=W6Qg6NrTIlROWiZjlcUgHvA4YqAO2DpE5nyR3C7rQFQ=; b=nvI5SwlsAPhTuvqFPTB3GuL/B+QCa+zPUsWLeMWX7YpY11iAh3MFL30SU/+V3bwdxwh8e+ ZyYhToq6zIzYvBzx5rlhY73fAVS1iQwkFUg1UGhw+7q6NGZXDVO212aAG738Ei5jtLmxLO ypONspm1wUXYvVcUMZdGxckO/Njn/li4NPqJIaUlTJo9oHGXkyJoU9pR5hCTnq1OKvhoRe RkFge5qcAbjLfQz+6wGKLv6Z0CKsSMkY0MCdbP/RXaErWOYNrt1aHE/v3XnEVM+9tAwkKG PGpd4fUtQ6+67CRU4lKYcgNtgnAQG8nZ0Y0nDPF9l46G+6GnLXu6CoRAQxY6zQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1746436793; 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=W6Qg6NrTIlROWiZjlcUgHvA4YqAO2DpE5nyR3C7rQFQ=; b=zheezx5IlnBjMiIDjMWFHfAOZrPQThdRZ9OW1imtBKxIG6xMhn/nibThjb6FXu0D23q3fZ M9Hyk4+xnPKtTsCQ== Date: Mon, 05 May 2025 11:19:39 +0200 Subject: [PATCH v2 5/8] selftests: vDSO: vdso_config: Avoid -Wunused-variables Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250505-selftests-vdso-fixes-v2-5-3bc86e42f242@linutronix.de> References: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> In-Reply-To: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , "Jason A. Donenfeld" Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Muhammad Usama Anjum , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1746436782; l=1265; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Jd9bN1x0QUY5vumCRf0DJ1rTzHAMY7u+Dc+/Xk5jW5Y=; b=5YiU/yIHq3zqWKEq6iVG30zLHPOf3nSun7uvoGK9aY/mBy7XD9w1u+DFYCudIFG219jf0y0/k fMn60mUbAN8DNw2USJkDK4qeU/J5wHrWdJ9SlgjTpsa6BSffj33+EkF X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Not all users of this header make use of all its variables. For example vdso_test_correctness.c does not use "versions": In file included from vdso_test_correctness.c:22: vdso_config.h:61:20: warning: ‘versions’ defined but not used [-Wunused-variable] 61 | static const char *versions[7] = { | ^~~~~~~~ Avoid those warnings through attribute((unused)). Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/vDSO/vdso_config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/vDSO/vdso_config.h b/tools/testing/selftests/vDSO/vdso_config.h index 722260f9756198956f0dfccced907284b6851e76..5fdd0f36233742bc47ae79f23d2cfae5a0f56dee 100644 --- a/tools/testing/selftests/vDSO/vdso_config.h +++ b/tools/testing/selftests/vDSO/vdso_config.h @@ -58,6 +58,7 @@ #define VDSO_NAMES 1 #endif +__attribute__((unused)) static const char *versions[7] = { "LINUX_2.6", "LINUX_2.6.15", @@ -68,6 +69,7 @@ static const char *versions[7] = { "LINUX_5.10" }; +__attribute__((unused)) static const char *names[2][7] = { { "__kernel_gettimeofday", From patchwork Mon May 5 09:19:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 888379 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 0DB901FCCF7; Mon, 5 May 2025 09:19:56 +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=1746436798; cv=none; b=pmWLjysSj1ImghPk6OJWCVlyreS0QCQZk8yOZmycXHFy2iIi7pw9kzdQTU+g0ZfuUaTpV2OkOIEeqK3v1p+7ZExsp2lydlMC9iVntMWoWbI5hE7CH2GRNwJ9CSGx2mTdyzlcp008AWufvUWO7vmLoJiNn+H+ctFFcQagw6PL3dI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746436798; c=relaxed/simple; bh=uD04YrH6eP+MSUFpj7sOWp6lkwXWk2qR0mSs3ZdsWmk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AHwkntHlkiwBdjRnm2VTJCwdcBn8eDdSe7BUgnwjPOnADA8ilwkftLhJTUOnFaOQUDJx66WkOa029PBpJDsHZXoCStxnPj2DOIU50k87OqWRnboELzHMevOfuLBE1fmVlSmg3VVum03MFreBXBtFCCK6DHQObLDhF79koTTWyuI= 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=fzPVyl4H; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=XhrnIBYf; 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="fzPVyl4H"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="XhrnIBYf" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1746436795; 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=eWSNBEL32B/DJ88mUkY5bg1Q8T/PlsPV4zRBXnQvYTs=; b=fzPVyl4HzwPLCEAA1hwLtIjxUSceIpW8hrAGSiPXBS4nX0bz8tSAMgauD0zzWvd/u/gOMh TR57IxFQ3TwF8zo+NRd5Yy/M9zYMCRLZyv1GDUzPelXk6oXSaDv/DHuGPr9kP7bCiRDjgo 06aIUnVYaySzbyjhrak6ICACujIz3YVDZVrZOz/FlLUWVw6A1ByUKLEi20Vupf9O3ZFnq/ 7mkv0RBb2EBor9CMbvlDakR28AwB08RxTTad5+XlA1Nq9JWtk8cTOTqkjOGI78+obnmmdK 19ricZ76PdetYWPQ9YfGjuZikRAsnHyK+M+Qe58Ishp+52+j6RrCJiwqN8PxWw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1746436795; 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=eWSNBEL32B/DJ88mUkY5bg1Q8T/PlsPV4zRBXnQvYTs=; b=XhrnIBYfIK3Dy7RGFsm1QFHcAcTjPt5AHdYQlbjqyepoq6dzn4HqadXUgUMUKhUh2X5ZxL WrEaqWymVMsNgsDw== Date: Mon, 05 May 2025 11:19:40 +0200 Subject: [PATCH v2 6/8] selftests: vDSO: enable -Wall Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250505-selftests-vdso-fixes-v2-6-3bc86e42f242@linutronix.de> References: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> In-Reply-To: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , "Jason A. Donenfeld" Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Muhammad Usama Anjum , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1746436782; l=839; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=uD04YrH6eP+MSUFpj7sOWp6lkwXWk2qR0mSs3ZdsWmk=; b=h9nt5RE2n6qHouwO8zWTZEkF94KoIouAWEsduey5lvviw5AFCv6pofmRR/ZOktNXb+ZCQC8JI Uz1XMaVEkXBAAo9J/IQQ8x1wnRKc3abm7Cppc4GIIXsWtNvhjAf/B/q X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Protect against common programming errors through compiler warnings. These warnings are also used for the kernel itself. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile index 12a0614b9fd4983deffe5d6a7cfa06ba8d92a516..06d72254ec75dbdcc2b20935534199fabc40a9de 100644 --- a/tools/testing/selftests/vDSO/Makefile +++ b/tools/testing/selftests/vDSO/Makefile @@ -12,7 +12,7 @@ TEST_GEN_PROGS += vdso_test_correctness TEST_GEN_PROGS += vdso_test_getrandom TEST_GEN_PROGS += vdso_test_chacha -CFLAGS := -std=gnu99 -O2 +CFLAGS := -std=gnu99 -O2 -Wall ifeq ($(CONFIG_X86_32),y) LDLIBS += -lgcc_s From patchwork Mon May 5 09:19:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 887672 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 924811FE46D; Mon, 5 May 2025 09:19:58 +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=1746436800; cv=none; b=N2926nUrVU9KOfumv/E0JPQX5tYMfQ+9Q0rxJb6g/1MiS86b7En9HN0dCJdqBSAAuzzm/Vw5Ai4+FbxB4mFOwitdwXfgjo5C7iRSpQJmCTWo90hNyYWkHH3M3gPhbNbvB4yJtpbyWODyMszh+F5RO4LLz/LL6NgkJiW/MT7DaJ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746436800; c=relaxed/simple; bh=NofZC/DmnGUuNGlTi2IqNXpglr+RDL+aFfdurFKJ/WI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MDA0/RT0ZGwk1K/3i5zKnNQvSiSORwm/ee7jfKaY8Z3cz/UM7eeTh4sB2cSYL0/E1m4eRCVDWFYuEq/WBXU8OnJTbF3XSPh4rHak3JCXHQRkqklzCeh8j92NMteN3UNGiYmhLoLJxAj83oxtuR2iIylp/C8TyIZQLUYSqEGrwJc= 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=Ko7tEoKB; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=TjbbwK4t; 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="Ko7tEoKB"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="TjbbwK4t" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1746436796; 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=EpSgt7v8Hrv9itXHHVUXHleGLHRYcjyC62pnB8nU680=; b=Ko7tEoKBqwcH5ylgnqflLeA+PFzAdbjBolB5pq5Oh365k802ZcEgT3q9gPqafuaQpRwJRA AIBE16biVJIhFvFqWD0CRa211BAhuxWbVCgKOoVLdKMdptUVgyi+odZfPkm002OXpwcm/d PoQlRa7HYWlLctdAsEFPIx4ORWzb+BEKE2+TX+bQhQnpfCwDuXwMrnVsh0XljS4KgZLXPW F0o+zXQnjNPdz6FNM5dcrTZwvOoUlJaOX+tTlxG2XgVwb4N3YNTeFVVQJ6Iylqb0PyoJmL MjEhbIWCN/ILoS3oXtn+PjWvaOXgZ91dO/xh9YMFrZ2CKcg7vORmw4gis3bVFw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1746436796; 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=EpSgt7v8Hrv9itXHHVUXHleGLHRYcjyC62pnB8nU680=; b=TjbbwK4tyOLsWLOK06H8UsATrSPLz7fc6A96WdgGUpQQ3gYxuSZKvN8MnV3JWK/wD8KA5r byLxq+8Bvn2bt7BQ== Date: Mon, 05 May 2025 11:19:41 +0200 Subject: [PATCH v2 7/8] selftests: vDSO: vdso_test_correctness: Fix -Wstrict-prototypes Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250505-selftests-vdso-fixes-v2-7-3bc86e42f242@linutronix.de> References: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> In-Reply-To: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , "Jason A. Donenfeld" Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Muhammad Usama Anjum , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1746436782; l=1813; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=NofZC/DmnGUuNGlTi2IqNXpglr+RDL+aFfdurFKJ/WI=; b=FoQaxDdRmUXL311eQvrGxpFjqNYX+GxlfAF7rWSSYg0RCW3JU+7hzn0zaMZJCh7w3uT2aY5H6 YUUF9Ob01ICD6QcuYzbiuHzWMw8RhaHXtjpvO8lap6ZShzCGKG8wxpE X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= Functions definitions without any argument list produce a warning with -Wstrict-prototypes: vdso_test_correctness.c:111:13: warning: function declaration isn’t a prototype [-Wstrict-prototypes] 111 | static void fill_function_pointers() | ^~~~~~~~~~~~~~~~~~~~~~ Explicitly use an empty argument list. Now that all selftests a free of this warning, enable it in the Makefile. Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/Makefile | 2 +- tools/testing/selftests/vDSO/vdso_test_correctness.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile index 06d72254ec75dbdcc2b20935534199fabc40a9de..918a2caa070ebc681a9525f0518afffcf10f5ae3 100644 --- a/tools/testing/selftests/vDSO/Makefile +++ b/tools/testing/selftests/vDSO/Makefile @@ -12,7 +12,7 @@ TEST_GEN_PROGS += vdso_test_correctness TEST_GEN_PROGS += vdso_test_getrandom TEST_GEN_PROGS += vdso_test_chacha -CFLAGS := -std=gnu99 -O2 -Wall +CFLAGS := -std=gnu99 -O2 -Wall -Wstrict-prototypes ifeq ($(CONFIG_X86_32),y) LDLIBS += -lgcc_s diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c index 5fb97ad67eeaf17b6cfa4f82783c57894f03e5c5..da651cf53c6ca4242085de109c7fc57bd807297c 100644 --- a/tools/testing/selftests/vDSO/vdso_test_correctness.c +++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c @@ -108,7 +108,7 @@ static void *vsyscall_getcpu(void) } -static void fill_function_pointers() +static void fill_function_pointers(void) { void *vdso = dlopen("linux-vdso.so.1", RTLD_LAZY | RTLD_LOCAL | RTLD_NOLOAD); From patchwork Mon May 5 09:19:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 888378 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 2CB2E1FF7C8; Mon, 5 May 2025 09:19:59 +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=1746436801; cv=none; b=quByZT+7XcOOANtMkEd2SGpH3py9U3fs4E0ZlfdppLUWdz7WMP5EMrbV173znVWv8hg8RviUwqB9kndD2iFYJTu6UWh0XaweEbsHUNhy/Nf79KbJEBzZIsfMTxu4o6jkARV3iAeOpJbCjLu2kPIyYjP/tkHuoXNQQlrttH0kFiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746436801; c=relaxed/simple; bh=LrPMG95dKgGbiAYQg277cmPat1A7mSTaBb/d6Yl1tek=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Im/BAOeezW638RTUT/XyZMRNqDD8GKjgDt9QKagpm/urem84cvFCjDbD4igxoz8Z4jGZMD9KUU6YrgAKfUXqgJQjG0MxtVcYyIZOu2neNihRsHR5QUjI/UvssAij37iWphYQRRCwCyU4Dtwflr4h1YsajU9LBxzpThDUyF3UwmM= 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=xAOPXiUo; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WcL3FKfp; 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="xAOPXiUo"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WcL3FKfp" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1746436798; 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=fJZ10Yp7MhEsztXardnZ3o9+hUAS27m0b/3zN5qur1k=; b=xAOPXiUoI2MhMPOtq8rrkZE6QCpU5ZP2rJVkPNn3vApdYSzV0hE7URMrUoXCHcQGP7u1gP km3fCZvrj/yHmcgLT3OC01/MDFbagklj8s7QiCsRQf6VYccDXWptuZxL4AOKsgBqSXZzWD LjJBIbbSK+kxf7U5AIkl0r5ZyZS2GouNayo3yneE8xOXUyN3fNwtvNntpJXm5E8cHmlVUx q3x/GolmCRZqWEtGVCxoHbJ4Jq3DzweZ2IxoDN5tdK9MKM9XZdA/v6Es42krJ3FUVeMIyv J29meIqSDu4lNYhgOv0X8wJKZs4ZPRXCUSBJUV+WqHa6zVeWcT/UCKHtQX36pw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1746436798; 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=fJZ10Yp7MhEsztXardnZ3o9+hUAS27m0b/3zN5qur1k=; b=WcL3FKfp6TSG7plDcg6UFqcTg5sWOxbI2PU8B0V8ilbfz7cfij2qC31EVkGGDxSrYHTIA/ TpSonREFmdBf2LBQ== Date: Mon, 05 May 2025 11:19:42 +0200 Subject: [PATCH v2 8/8] selftests: vDSO: vdso_test_getrandom: Always print TAP header Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250505-selftests-vdso-fixes-v2-8-3bc86e42f242@linutronix.de> References: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> In-Reply-To: <20250505-selftests-vdso-fixes-v2-0-3bc86e42f242@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan , "Jason A. Donenfeld" Cc: Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Muhammad Usama Anjum , =?utf-8?q?Thomas_Wei?= =?utf-8?q?=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1746436782; l=1385; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=LrPMG95dKgGbiAYQg277cmPat1A7mSTaBb/d6Yl1tek=; b=Zq9lwnymbRFL3MumdIS/RIacWiN5xqEs/2BpmchWcv0vHw+kUICQ6xcdDG/OCrLmeABpZwfvr 0DQU6WhXgWSBIStR8km05J+kbmhVgwGzqQZ4cKS5HyeduqD+7SCJP87 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The TAP specification requires that the output begins with a header line. If vgetrandom_init() fails and skips the test, that header line is missing. Call vgetrandom_init() after ksft_print_header(). Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/vDSO/vdso_test_getrandom.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_getrandom.c b/tools/testing/selftests/vDSO/vdso_test_getrandom.c index b0e0d664508a38d6dde9df0a61ec8198ee928a17..01892d8e65d754d0353f7df2b63910d5be8cd1bc 100644 --- a/tools/testing/selftests/vDSO/vdso_test_getrandom.c +++ b/tools/testing/selftests/vDSO/vdso_test_getrandom.c @@ -232,6 +232,7 @@ static void kselftest(void) pid_t child; ksft_print_header(); + vgetrandom_init(); ksft_set_plan(2); for (size_t i = 0; i < 1000; ++i) { @@ -285,8 +286,6 @@ static void usage(const char *argv0) int main(int argc, char *argv[]) { - vgetrandom_init(); - if (argc == 1) { kselftest(); return 0; @@ -296,6 +295,9 @@ int main(int argc, char *argv[]) usage(argv[0]); return 1; } + + vgetrandom_init(); + if (!strcmp(argv[1], "bench-single")) bench_single(); else if (!strcmp(argv[1], "bench-multi"))