]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
kselftest/arm64: Fix enumeration of systems without 128 bit SME
authorMark Brown <broonie@kernel.org>
Tue, 31 Jan 2023 22:56:34 +0000 (22:56 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:32:58 +0000 (09:32 +0100)
[ Upstream commit 5f389238534ac8ca4ee3ab12eeb89d3984d303a1 ]

The current signal handling tests for SME do not account for the fact that
unlike SVE all SME vector lengths are optional so we can't guarantee that
we will encounter the minimum possible VL, they will hang enumerating VLs
on such systems. Abort enumeration when we find the lowest VL.

Fixes: 4963aeb35a9e ("kselftest/arm64: signal: Add SME signal handling tests")
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230131-arm64-kselftest-sig-sme-no-128-v1-1-d47c13dc8e1e@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/arm64/signal/testcases/ssve_regs.c
tools/testing/selftests/arm64/signal/testcases/za_regs.c

index d0a178945b1a82bb0097e18075ddce897d7b1c9a..c6b17c47cac4cb25476fac40616b23d40c4c2a40 100644 (file)
@@ -34,6 +34,10 @@ static bool sme_get_vls(struct tdescr *td)
 
                vl &= PR_SME_VL_LEN_MASK;
 
+               /* Did we find the lowest supported VL? */
+               if (vq < sve_vq_from_vl(vl))
+                       break;
+
                /* Skip missing VLs */
                vq = sve_vq_from_vl(vl);
 
index ea45acb115d5b2338c31f62d37b39e5e6475a7ac..174ad665669647042e4dc7e040ec8d852b55cd62 100644 (file)
@@ -34,6 +34,10 @@ static bool sme_get_vls(struct tdescr *td)
 
                vl &= PR_SME_VL_LEN_MASK;
 
+               /* Did we find the lowest supported VL? */
+               if (vq < sve_vq_from_vl(vl))
+                       break;
+
                /* Skip missing VLs */
                vq = sve_vq_from_vl(vl);