diff options
author | Joey Gouly <joey.gouly@arm.com> | 2023-09-19 18:27:57 +0200 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2023-10-13 20:12:03 +0200 |
commit | 80652cc0c0485da593c1639a6355dcdab95364e6 (patch) | |
tree | 7d5e157acd2a7102b1074518cdcc5c241efe2629 /tools/testing/selftests/arm64 | |
parent | arm64: add FEAT_LRCPC3 HWCAP (diff) | |
download | linux-80652cc0c0485da593c1639a6355dcdab95364e6.tar.xz linux-80652cc0c0485da593c1639a6355dcdab95364e6.zip |
selftests/arm64: add HWCAP2_LRCPC3 test
Add a test for the newly added HWCAP2_LRCPC3.
Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20230919162757.2707023-3-joey.gouly@arm.com
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.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c index d8a144213d04..a60f23794944 100644 --- a/tools/testing/selftests/arm64/abi/hwcap.c +++ b/tools/testing/selftests/arm64/abi/hwcap.c @@ -295,6 +295,19 @@ static void uscat_sigbus(void) asm volatile(".inst 0xb820003f" : : : ); } +static void lrcpc3_sigill(void) +{ + int data[2] = { 1, 2 }; + + register int *src asm ("x0") = data; + register int data0 asm ("w2") = 0; + register int data1 asm ("w3") = 0; + + /* LDIAPP w2, w3, [x0] */ + asm volatile(".inst 0x99431802" + : "=r" (data0), "=r" (data1) : "r" (src) :); +} + static const struct hwcap_data { const char *name; unsigned long at_hwcap; @@ -355,6 +368,13 @@ static const struct hwcap_data { .sigill_fn = ilrcpc_sigill, }, { + .name = "LRCPC3", + .at_hwcap = AT_HWCAP2, + .hwcap_bit = HWCAP2_LRCPC3, + .cpuinfo = "lrcpc3", + .sigill_fn = lrcpc3_sigill, + }, + { .name = "LSE", .at_hwcap = AT_HWCAP, .hwcap_bit = HWCAP_ATOMICS, |