Commit 09d2e95a authored by Zeng Heng's avatar Zeng Heng Committed by Will Deacon
Browse files

kselftest/arm64: add crc32 feature to hwcap test



Add the CRC32 feature check in the set of hwcap tests.

Signed-off-by: default avatarZeng Heng <zengheng4@huawei.com>
Reviewed-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230808134036.668954-3-zengheng4@huawei.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent eb27c76a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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 */
@@ -233,6 +238,13 @@ static const struct hwcap_data {
	sigill_fn sigill_fn;
	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,