[PATCH 0/2] selftests/arm64: Add cmpbr_sigill() and fix sve2p1_sigill() for hwcap test

Yifan Wu wuyifan50 at huawei.com
Thu Feb 26 19:19:31 PST 2026


Hi all,

This patch series adds and fixes two selftests in the arm64 hwcap
test suite.

Patch 1/2 implements the cmpbr_sigill() test to correctly detect
the presence of the CMPBR extension. The test uses the CBEQ
instruction, which is valid only if the CPU supports the extension.
If supported, a branch is taken and the UDF instruction is skipped,
avoiding a SIGILL. Otherwise, the UDF is executed and a SIGILL
is generated.

Patch 2/2 fixes the sve2p1_sigill() test to correctly detect the
FEAT_SVE2p1 feature. Previously, the test incorrectly assumed that
the presence of FEAT_SVE2.1 implied support for the BFADD
instruction, which actually depends on the FEAT_SVE_B16B16 feature.
The test is updated to use the LD1Q instruction, which is
unambiguously implied by FEAT_SVE2p1.

These changes improve the accuracy and reliability of the selftests
for arm64 hardware capability detection.

References:

CBEQ: https://developer.arm.com/documentation/ddi0602/2025-12/Base-Instructions/CB-cc---register---Compare-registers-and-branch-?lang=en
BFADD: https://developer.arm.com/documentation/ddi0602/2025-12/SVE-Instructions/BFADD--unpredicated---BFloat16-add--unpredicated--?lang=en
LD1Q: https://developer.arm.com/documentation/ddi0602/2025-12/SVE-Instructions/LD1Q--Gather-load-quadwords-?lang=en
ID_AA64ZFR0_EL1: https://developer.arm.com/documentation/ddi0601/2025-03/AArch64-Registers/ID-AA64ZFR0-EL1--SVE-Feature-ID-Register-0?lang=en

Yifan Wu (2):
  selftests/arm64: Implement cmpbr_sigill() to hwcap test
  selftest/arm64: Fix sve2p1_sigill() to hwcap test

 tools/testing/selftests/arm64/abi/hwcap.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

-- 
2.33.0




More information about the linux-arm-kernel mailing list