From patchwork Mon Mar 24 14:03:15 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: 14027421 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 88DCB19C569; Mon, 24 Mar 2025 14:03:26 +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=1742825008; cv=none; b=cx54sbb8ophJMHYJTeflWQgnUHX8HN/Hi9zvio5a2wW7c4Eu7rsOFR9UlyvChxDdSUJwxOleE6o/VOVxQucaytw5BdliN9vMQ3u+qh83yaGveg89gAPIstj0bPPE1Sw0RqrrzDa48KffJRri+ARW+4hVvkO7wn1+n6WCPoJVi8I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742825008; c=relaxed/simple; bh=AV16hwPQKl+CSfzRvFHoenJEQJcXjUzffLuSmOe1gmc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RmeDAKxwOnWzSPS9t8PW0CFQ2sgxngaOXXaNZjVSzpPVfW4JrU8qoVoE17BohL1XFwNgQhlKwIQe/CZQOb39h4mzTyWmbhtVMcehXyOX9FO1SUJghk99JWAcbhyMZHqAyupxBmjPo9+2mw0i935pEFJyPi4RquXog4gHybqgeGI= 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=KjME5Vzt; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=KddMDaGa; 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="KjME5Vzt"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KddMDaGa" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1742825004; 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=Vy/QI8gjPC2C7/T4R6qzuHLJYY475S+lLnFmzkVsNQ4=; b=KjME5VztaJQ3eE5DWN+DpKo452vBorX4W/fyAb2ohDGhBNuv47LQpxI+/NMU6xp1rP9FXv O8BohdwieUsxsgcmQM5m5vOt+pNh9xdZIZ4zsTh7LVDPyh3vZjjlLQE3IFyW18NAoxNhBy WHhuDIeBdwedIyIThMNGSX2ybBQDYXoBS4j50ZWR5zVoB6cVimGRGYRXqEB+M+EJmXFecQ eD6Tf+FNZOkSRFc+PnMFDSPzKigFChxKIJLctFVxqvoDFSlbjVWrIZf5Wll4Ip5QgBj137 BYitudshT2oPFdFoNdshjdU5DPoD3LcjshcoUPq6WR1XdWVrZQByS2Bq01RvuA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1742825004; 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=Vy/QI8gjPC2C7/T4R6qzuHLJYY475S+lLnFmzkVsNQ4=; b=KddMDaGa5jb01AdHGhy7Jj92SKhZW8Aj7GsTQPe2jL9GvvUQeumkNcNWQecw3XT5x+p8wL DUQzGEIS6BxdCSBQ== Date: Mon, 24 Mar 2025 15:03:15 +0100 Subject: [PATCH 1/3] 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: <20250324-s390-vdso-hwcap-v1-1-cb9ad001ceba@linutronix.de> References: <20250324-s390-vdso-hwcap-v1-0-cb9ad001ceba@linutronix.de> In-Reply-To: <20250324-s390-vdso-hwcap-v1-0-cb9ad001ceba@linutronix.de> To: Shuah Khan , "Jason A. Donenfeld" , Heiko Carstens , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1742825002; l=1633; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=AV16hwPQKl+CSfzRvFHoenJEQJcXjUzffLuSmOe1gmc=; b=0xAtEuSQU3A8XP39oNocbm/9ZD42xb/JP0FotpP7k6ZZh3MP7maG0rX/WuWUe9qHyrqB6K6Kq 5w29qaY9EAwD90W/G6uKi9Ijx8iLXdaB/qXGlnvssFJDp4kRx91z3KS 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") 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 Mar 24 14:03:16 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: 14027422 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 EB2F425DD0F; Mon, 24 Mar 2025 14:03:26 +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=1742825008; cv=none; b=u0g7nOwT6GtSwahXfwBFmCECsdyYzb2ozmbDPZQVJIIqGA3qTS28Ql6g85fbk88y0oAGgFNQT88LPoQVb6bPtjCmmiSLS2a5+MSQP3saHSxfEEPtIU4h8ACsFPRDxt8Vo/9FGfW8HvL6qVwANiXT5LDlrUBumiwWaRZ1/bYLxfo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742825008; c=relaxed/simple; bh=UKRxzSlR9qZ2gdAbfbAsj0yhw+zUOuNB45hNx8tgRn4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kxEloFNd95Rr7Hafz3fcGULNY/Yk2wWk/qsWkaSMhiHhijfhRawwMkeu44O+YGhCU4EptP75G5cKk4oMmd4bUNhM03WnJXUCjhuynCX+9/wYCXK58RtSazWbpOIbeswhaPlxtqkk+aue6/LXtocVWuC2ThIc+zIAWn5k37QxtOU= 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=01kmrGij; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=M2ZeCJ0N; 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="01kmrGij"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="M2ZeCJ0N" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1742825005; 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=pqmtgxCMSRE9rwr7I/eQlLiLcjGvYFOZTsJXW6vfQDc=; b=01kmrGijkS5Si/rY4hCL67sEVnkiPrP3ORqxHd2nHtfud1dPmzhWzk/Q3+MMPSZA5lnDCe MpEhsva5HWPr75Tis7nfQEYZLeDvQsFUHgt7wTyqwUli32mHlaXjoOPVGRTMnFGPqcwb1g m6z1LeMKep4loYpX9GTuNpg1yRy/AlMy/ftW/TjxDEzRNtZXfRq5U7CShdNPlJ9p3Sw0tG aAfEVsIUPZ5U9+CIhUu7WzitWuHNwRLSUYLstbWB4jWQCr3bhvSfY3rM+c1u6eZdXkYL84 oZiTmf9I7dH57RdOHfgr49amIvlApspaRBNOpysw1gUGaYMJm/Sh7sK3m6Adkw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1742825005; 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=pqmtgxCMSRE9rwr7I/eQlLiLcjGvYFOZTsJXW6vfQDc=; b=M2ZeCJ0NFrW4EaLYadVyejro0P9QuAZne/Ros8jk4p3nsZJFPS9Lxc7N9BwyMBuGtvfear 7Nr2L8FQ5kQyuGDA== Date: Mon, 24 Mar 2025 15:03:16 +0100 Subject: [PATCH 2/3] selftests: vDSO: chacha: Include asm/hwcap.h for arm64 Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250324-s390-vdso-hwcap-v1-2-cb9ad001ceba@linutronix.de> References: <20250324-s390-vdso-hwcap-v1-0-cb9ad001ceba@linutronix.de> In-Reply-To: <20250324-s390-vdso-hwcap-v1-0-cb9ad001ceba@linutronix.de> To: Shuah Khan , "Jason A. Donenfeld" , Heiko Carstens , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1742825002; l=987; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=UKRxzSlR9qZ2gdAbfbAsj0yhw+zUOuNB45hNx8tgRn4=; b=yMsLw736eWvO2GzABKg4jI9NzhALNqSMwQErgNZJgQlw8QHMVC2REnCNv+c8g44h27POO4/wh 8faZFBMkltiAiEfDgEKxBtCovgyJ+YSlPM+EYlxXliOMxlY2/7JwfCT X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= The hwcap constants are not available unconditionally. Include asm/hwcap.h to make them available. Not all architectures provide this header, so gate the inclusion behind an architecture-specific ifdef. Fixes: 210860e7f733 ("selftests: vDSO: check cpu caps before running chacha test") Signed-off-by: Thomas Weißschuh --- tools/testing/selftests/vDSO/vdso_test_chacha.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/vDSO/vdso_test_chacha.c b/tools/testing/selftests/vDSO/vdso_test_chacha.c index 0aad682b12c8836efabb49a65a47cf87466891a3..fd5c5108b42f04ec459d39b74f33edc2ceafbba1 100644 --- a/tools/testing/selftests/vDSO/vdso_test_chacha.c +++ b/tools/testing/selftests/vDSO/vdso_test_chacha.c @@ -13,6 +13,7 @@ #include "../kselftest.h" #if defined(__aarch64__) +#include static bool cpu_has_capabilities(void) { return getauxval(AT_HWCAP) & HWCAP_ASIMD; From patchwork Mon Mar 24 14:03:17 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: 14027423 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 8BD1925F7A4; Mon, 24 Mar 2025 14:03:27 +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=1742825009; cv=none; b=H+kUHtw5E6D9jg1ksCrtIacpUh8yjQh3ZdSUN2cBBrl9pJ10yRqtwhE0Dgy7LIlUScXujgZkQXjXjyu/kEwLch3L8jrjN7fjzzaBX1QSTrY1UsXTMwBb6xKkSCWpeOPH17kb7ht6DzYI/onyTc7P3u9xduFKPfOhW3Kh/N5bYtk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742825009; c=relaxed/simple; bh=aM4JcR3866WrCbYTHlk8iWIrMznIfA9/J8oATxvESHs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SsFMGPzfMJ4FOvfsj/XJK2yKqqkjYlgwHV362gvygxmc/FKFBIBxkVSqY993ZRAh/fasg+LZCFG7fd66sCd2Nvqz/OK93YzNEGpFppN+3Qx4bIx94TwotMf/pTMz4jkUYe9IHkVE4hwh7Y35MgboDckubwn9w9m1EDYZEmOQ4A8= 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=3XJJCaFd; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wLfI4hnZ; 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="3XJJCaFd"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wLfI4hnZ" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1742825005; 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=Qj8y0TcZWBHDPwJrLqATbmFxejNYXTMZhfjNczSoSVE=; b=3XJJCaFdkXm+QYPX/vthk0TDjyeoYkhXlf3y8Dj9SdklN0EzhdHBgL/ato2AH7IefIaBpU YJSvkPOYzk8xoonUpKiVxuLWsnTTq1MIJlsCN3vdSW9vFC/M7PTNVHQH1lpf6pNlkHPbBw PcJrNCkxJvsW7UDiTThd+TS4cOVc2CICXfChBPC50hUjMkmwK3/o9vYpaJ+qmXcNrnVx2G PC5qkCg+YaSkuwb/oBawx+Oz2SqJ2m47tqD32tGwJ+57D8bNok2jpRt74PO4ts+rOv++Q5 rIU9APdietC970maR5NbqaXpOlI8TCsaQGfBds5wSQfOi7odrq5JYs8nF0hTDQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1742825005; 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=Qj8y0TcZWBHDPwJrLqATbmFxejNYXTMZhfjNczSoSVE=; b=wLfI4hnZJg2uUCk87WAHgXKIA++xJA+AVboP+WaAOGoGzR/kF+DAsov+8ZGCH7CphXv4in Ru9NPQJdlzDjaACw== Date: Mon, 24 Mar 2025 15:03:17 +0100 Subject: [PATCH 3/3] selftests: vDSO: chacha: Provide default definition of HWCAP_S390_VXRS Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250324-s390-vdso-hwcap-v1-3-cb9ad001ceba@linutronix.de> References: <20250324-s390-vdso-hwcap-v1-0-cb9ad001ceba@linutronix.de> In-Reply-To: <20250324-s390-vdso-hwcap-v1-0-cb9ad001ceba@linutronix.de> To: Shuah Khan , "Jason A. Donenfeld" , Heiko Carstens , Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1742825002; l=1036; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=aM4JcR3866WrCbYTHlk8iWIrMznIfA9/J8oATxvESHs=; b=viBYPTwPx1ECWXIR3TyrNZisIuV6STuzuZCaWmK1duWGrECRobn/tdn6COju7kd9AZlsQgpb0 B55WnQz4kjrCNMaI9rAewd+r46UaNCicIe8E6GPEkgtGZIUmujeCXGe X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= s390 does not provide a hwcap.h UAPI header. Add an inline definition for the constant HWCAP_S390_VXRS until a proper UAPI header is introduced. Fixes: 210860e7f733 ("selftests: vDSO: check cpu caps before running chacha test") Signed-off-by: Thomas Weißschuh Acked-by: Heiko Carstens --- tools/testing/selftests/vDSO/vdso_test_chacha.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/testing/selftests/vDSO/vdso_test_chacha.c b/tools/testing/selftests/vDSO/vdso_test_chacha.c index fd5c5108b42f04ec459d39b74f33edc2ceafbba1..0ce5189718ce35b0a4d69b71559db8379b598b93 100644 --- a/tools/testing/selftests/vDSO/vdso_test_chacha.c +++ b/tools/testing/selftests/vDSO/vdso_test_chacha.c @@ -19,6 +19,9 @@ static bool cpu_has_capabilities(void) return getauxval(AT_HWCAP) & HWCAP_ASIMD; } #elif defined(__s390x__) +#ifndef HWCAP_S390_VXRS +#define HWCAP_S390_VXRS (1 << 11) +#endif static bool cpu_has_capabilities(void) { return getauxval(AT_HWCAP) & HWCAP_S390_VXRS;