Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEB86C6FA82 for ; Tue, 13 Sep 2022 14:17:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rVbuS9Hhi3BOCIdruYysjV94s42wdBpv+CZroTIRQr8=; b=ubXncFJ4HTMfh8 2IpWxIdX430+RJmqN7/ybZSMyG4bTj9ichSzrWwYXyEu8h/6eTjKenvIlg4lMVa1dMGYanRf8i59l 7Hrye256x89wfUkMWiYNEjbo4RntNuXrizlqy0SuoQutAQuOucytod2F53ywkS5RNiJmVWkOAR75l oBmG4yV7A5ZeDNAIAWl/P9GMa/dUE7q6b54dI8X35G88tA+bthM4smdktyVpjQdahAA1TY4JZpCn7 nblzzEimSku+JWLR2n6yA2ddnNX66zJedvsLDH2YdB43VMLH4npqaK1ccyAIt9jUGXn7Yz8TMumno c+musE9C2Po1dTckuVQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oY6hv-00BQQG-3P; Tue, 13 Sep 2022 14:16:11 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oY6dp-00BMnj-S7 for linux-arm-kernel@lists.infradead.org; Tue, 13 Sep 2022 14:11:59 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4CB59B80F1A; Tue, 13 Sep 2022 14:11:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FAF0C433C1; Tue, 13 Sep 2022 14:11:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663078315; bh=beifvSd0yZCf/rhb6goLcuPqGmCyFQ/KBjdE6tPJ6QA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vQbe0aY1RIi6/xcLONQ02TTGgNTtJ9MkN6Sackgo4LbNmpUGUL/ag3mJwPnjGPu/T TSZAiQgCvyjFZVZfsbA5mvvGuZ5s/T9qhmiEYCggnktMQNDgSJNPDB6R60ri1Cng2a 1sOgDO3S3wiPOIDzRQWdMkeytOmZn3SS42xep4yea0SIEMXqu5Dt+AVyxwt+yvRdmZ diXZscJY0is7Q6Wa0AWH4FRl34qLmJXZsdU5B69eO0hkzzjnEf5Z9D/pSKAo5uDhig il3BSF75d4JNW3KAYxIwyr0VngH7myzutoJ12u2ww2ShrYoySK7Fwls/10LHMCKbRL Q2qfzzCtnpw+w== From: Mark Brown To: Catalin Marinas , Will Deacon , Shuah Khan , Shuah Khan Cc: linux-arm-kernel@lists.infradead.org, linux-kselftest@vger.kernel.org, Mark Brown Subject: [PATCH v1 3/3] kselftest/arm64: Add hwcap test for RNG Date: Tue, 13 Sep 2022 15:11:01 +0100 Message-Id: <20220913141101.151400-4-broonie@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220913141101.151400-1-broonie@kernel.org> References: <20220913141101.151400-1-broonie@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1030; i=broonie@kernel.org; h=from:subject; bh=beifvSd0yZCf/rhb6goLcuPqGmCyFQ/KBjdE6tPJ6QA=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBjII90gcKY6uSnz9tFfY2jAbMa19gPEEyveQ1V4Ytn 1LC/BPWJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCYyCPdAAKCRAk1otyXVSH0OxzB/ 4y5iu5SKb3HvofGak5+WdjYkSzcZJxFjG2nkrJvTRDpQjzfwRTbudxAFOXxfCwE1VoGdl40pWOy3y9 7WCBRxj9jCZbMzgT5vqBU1tCBD4SwMTAhTLuNKrSWCnqeuLYDywpIJCRr0X4907jd70GVPpJ4mV1mm yTlFIa0Cqif23IiFGLTrcv9Lp5zGEKnFhwlmIj6LF8E9Iu3h+RHrNfUszNrlGtb5Z9bwX5RbOi3j2k C+cUp5E3Se1JbzoHNtGyU/9Uybdr82BUMtV4wV4yPOb8KQDY1EWh/uxClIUqETorwABwPtpKzS/xFV lU96m4kzlIKr2gFoxIg94ZPspVeOaM X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220913_071158_120267_872899EC X-CRM114-Status: GOOD ( 13.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Validate the RNG hwcap and make sure we don't generate a SIGILL reading RNDR when it is reported. Signed-off-by: Mark Brown --- tools/testing/selftests/arm64/abi/hwcap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c index 6c91b4a0987e..d173e41f2123 100644 --- a/tools/testing/selftests/arm64/abi/hwcap.c +++ b/tools/testing/selftests/arm64/abi/hwcap.c @@ -33,6 +33,11 @@ */ typedef void (*sigill_fn)(void); +static void rng_sigill(void) +{ + asm volatile("mrs x0, S3_3_C2_C4_0" : : : "x0"); +} + static void sme_sigill(void) { /* RDSVL x0, #0 */ @@ -113,6 +118,13 @@ static const struct hwcap_data { sigill_fn sigill_fn; bool sigill_reliable; } hwcaps[] = { + { + .name = "RNG", + .at_hwcap = AT_HWCAP2, + .hwcap_bit = HWCAP2_RNG, + .cpuinfo = "rng", + .sigill_fn = rng_sigill, + }, { .name = "SME", .at_hwcap = AT_HWCAP2, -- 2.30.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel