Skip to content

Commit 74cd4e0

Browse files
Yifan Wuctmarinas
authored andcommitted
selftests/arm64: Implement cmpbr_sigill() to hwcap test
The function executes a CBEQ instruction which is valid if the CPU supports the CMPBR extension. The CBEQ branches to skip the following UDF instruction, and no SIGILL is generated. Otherwise, it will generate a SIGILL. Signed-off-by: Yifan Wu <[email protected]> Reviewed-by: Mark Brown <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent 1f318b9 commit 74cd4e0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • tools/testing/selftests/arm64/abi

tools/testing/selftests/arm64/abi/hwcap.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ static void atomics_sigill(void)
5656

5757
static void cmpbr_sigill(void)
5858
{
59-
/* Not implemented, too complicated and unreliable anyway */
59+
asm volatile(".inst 0x74C00040\n" /* CBEQ w0, w0, +8 */
60+
"udf #0" : : : "cc"); /* UDF #0 */
6061
}
6162

6263
static void crc32_sigill(void)

0 commit comments

Comments
 (0)