aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/arm64
diff options
context:
space:
mode:
authorZeng Heng <zengheng4@huawei.com>2023-08-08 21:40:33 +0800
committerWill Deacon <will@kernel.org>2023-08-11 12:24:16 +0100
commit09d2e95a04ad6fd258082ea3ba9a5bf52bbd5229 (patch)
treef1bc34449aa0f1963484413b94a8603ac321af94 /tools/testing/selftests/arm64
parentkselftest/arm64: add float-point feature to hwcap test (diff)
downloadwireguard-linux-09d2e95a04ad6fd258082ea3ba9a5bf52bbd5229.tar.xz
wireguard-linux-09d2e95a04ad6fd258082ea3ba9a5bf52bbd5229.zip
kselftest/arm64: add crc32 feature to hwcap test
Add the CRC32 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/20230808134036.668954-3-zengheng4@huawei.com Signed-off-by: Will Deacon <will@kernel.org>
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 ec247587f2bf..70850bdb0e35 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 crc32_sigill(void)
+{
+ asm volatile("crc32w w0, w0, w1");
+}
+
static void cssc_sigill(void)
{
/* CNT x0, x0 */
@@ -234,6 +239,13 @@ static const struct hwcap_data {
bool sigill_reliable;
} hwcaps[] = {
{
+ .name = "CRC32",
+ .at_hwcap = AT_HWCAP,
+ .hwcap_bit = HWCAP_CRC32,
+ .cpuinfo = "crc32",
+ .sigill_fn = crc32_sigill,
+ },
+ {
.name = "CSSC",
.at_hwcap = AT_HWCAP2,
.hwcap_bit = HWCAP2_CSSC,