Commit 3fc3c0d1 authored by Zeng Heng's avatar Zeng Heng Committed by Will Deacon
Browse files

kselftest/arm64: add AES feature check to hwcap test



Add the AES 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/20230815040915.3966955-3-zengheng4@huawei.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent 7eb4ee66
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -34,6 +34,12 @@
 */
typedef void (*sig_fn)(void);

static void aes_sigill(void)
{
	/* AESE V0.16B, V0.16B */
	asm volatile(".inst 0x4e284800" : : : );
}

static void atomics_sigill(void)
{
	/* STADD W0, [SP] */
@@ -273,6 +279,13 @@ static const struct hwcap_data {
	sig_fn sigbus_fn;
	bool sigbus_reliable;
} hwcaps[] = {
	{
		.name = "AES",
		.at_hwcap = AT_HWCAP,
		.hwcap_bit = HWCAP_AES,
		.cpuinfo = "aes",
		.sigill_fn = aes_sigill,
	},
	{
		.name = "CRC32",
		.at_hwcap = AT_HWCAP,