summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/arm64/abi/syscall-abi.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2022-12-27 16:06:35 +0300
committerCatalin Marinas <catalin.marinas@arm.com>2023-01-12 19:20:31 +0300
commit97ec597b26df774a257e3f8e97353fd1b4471615 (patch)
tree895f2dbd1b8299b3e57f3f5f16384b6ba3da34c8 /tools/testing/selftests/arm64/abi/syscall-abi.c
parentb7bfaa761d760e72a969d116517eaa12e404c262 (diff)
downloadlinux-97ec597b26df774a257e3f8e97353fd1b4471615.tar.xz
kselftest/arm64: Fix syscall-abi for systems without 128 bit SME
SME does not mandate any specific VL so we may not have 128 bit SME but the algorithm used for enumerating VLs assumes that we will. Add the required check to ensure that the algorithm terminates. Fixes: 43e3f85523e4 ("kselftest/arm64: Add SME support to syscall ABI test") Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20221223-arm64-syscall-abi-sme-only-v1-1-4fabfbd62087@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'tools/testing/selftests/arm64/abi/syscall-abi.c')
-rw-r--r--tools/testing/selftests/arm64/abi/syscall-abi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/arm64/abi/syscall-abi.c b/tools/testing/selftests/arm64/abi/syscall-abi.c
index dd7ebe536d05..ffe719b50c21 100644
--- a/tools/testing/selftests/arm64/abi/syscall-abi.c
+++ b/tools/testing/selftests/arm64/abi/syscall-abi.c
@@ -390,6 +390,10 @@ static void test_one_syscall(struct syscall_cfg *cfg)
sme_vl &= PR_SME_VL_LEN_MASK;
+ /* Found lowest VL */
+ if (sve_vq_from_vl(sme_vl) > sme_vq)
+ break;
+
if (sme_vq != sve_vq_from_vl(sme_vl))
sme_vq = sve_vq_from_vl(sme_vl);
@@ -461,6 +465,10 @@ int sme_count_vls(void)
vl &= PR_SME_VL_LEN_MASK;
+ /* Found lowest VL */
+ if (sve_vq_from_vl(vl) > vq)
+ break;
+
if (vq != sve_vq_from_vl(vl))
vq = sve_vq_from_vl(vl);