aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/arm64
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-09-13 15:11:01 +0100
committerCatalin Marinas <catalin.marinas@arm.com>2022-09-16 12:40:58 +0100
commitef939f30510b43e90f1fba30477b678107faeae7 (patch)
treed9a88bd7370d70db3d0e9ff0300030384a1849e2 /tools/testing/selftests/arm64
parentkselftest/arm64: Add SVE 2 to the tested hwcaps (diff)
downloadlinux-dev-ef939f30510b43e90f1fba30477b678107faeae7.tar.xz
linux-dev-ef939f30510b43e90f1fba30477b678107faeae7.zip
kselftest/arm64: Add hwcap test for RNG
Validate the RNG hwcap and make sure we don't generate a SIGILL reading RNDR when it is reported. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20220913141101.151400-4-broonie@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'tools/testing/selftests/arm64')
-rw-r--r--tools/testing/selftests/arm64/abi/hwcap.c12
1 files changed, 12 insertions, 0 deletions
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 */
@@ -114,6 +119,13 @@ static const struct hwcap_data {
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,
.hwcap_bit = HWCAP2_SME,