kselftest/arm64: add pmull feature to hwcap test
authorZeng Heng <zengheng4@huawei.com>
Tue, 15 Aug 2023 04:09:14 +0000 (12:09 +0800)
committerWill Deacon <will@kernel.org>
Wed, 16 Aug 2023 14:24:01 +0000 (15:24 +0100)
Add the pmull feature check in the set of hwcap tests.

Signed-off-by: Zeng Heng <zengheng4@huawei.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230815040915.3966955-4-zengheng4@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
tools/testing/selftests/arm64/abi/hwcap.c

index 96c2611f1ac00ae86b2469f70106f36a802d089d..b3492a944503c55a1c02028ea4a67d63936a5cd9 100644 (file)
@@ -88,6 +88,12 @@ static void mops_sigill(void)
                     : "cc", "memory");
 }
 
+static void pmull_sigill(void)
+{
+       /* PMULL V0.1Q, V0.1D, V0.1D */
+       asm volatile(".inst 0x0ee0e000" : : : );
+}
+
 static void rng_sigill(void)
 {
        asm volatile("mrs x0, S3_3_C2_C4_0" : : : "x0");
@@ -345,6 +351,13 @@ static const struct hwcap_data {
                .sigill_fn = mops_sigill,
                .sigill_reliable = true,
        },
+       {
+               .name = "PMULL",
+               .at_hwcap = AT_HWCAP,
+               .hwcap_bit = HWCAP_PMULL,
+               .cpuinfo = "pmull",
+               .sigill_fn = pmull_sigill,
+       },
        {
                .name = "RNG",
                .at_hwcap = AT_HWCAP2,