diff mbox series

kselftest/arm64: Skip non-power of 2 SVE vector lengths in fp-stress

Message ID 20221220-arm64-fp-stress-pow2-v1-1-d0ce756b57af@kernel.org (mailing list archive)
State Accepted
Commit 67f49869106f78882a8a09b736d4884be85aba18
Headers show
Series kselftest/arm64: Skip non-power of 2 SVE vector lengths in fp-stress | expand

Commit Message

Mark Brown Dec. 27, 2022, 1:07 p.m. UTC
As documented in issue C215 in the known issues list for DDI0487I.a [1] Arm
will be making a retroactive change to SVE to remove the possibility of
selecting non power of two vector lengths. This has no impact on existing
physical implementations but most virtual implementations have implemented
the full range of permissible vector lengths. Given how demanding fp-stress
is for these implementations update to only attempt to enumerate the power
of two vector lengths, reducing the load created on existing virtual
implementations and only exercising the functionality that will be seen in
physical implementations.

[1] https://developer.arm.com/documentation/102105/ia-00/

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 tools/testing/selftests/arm64/fp/fp-stress.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


---
base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
change-id: 20221220-arm64-fp-stress-pow2-b81ee6471492

Best regards,

Comments

Catalin Marinas Jan. 12, 2023, 5:49 p.m. UTC | #1
On Tue, 27 Dec 2022 13:07:45 +0000, Mark Brown wrote:
> As documented in issue C215 in the known issues list for DDI0487I.a [1] Arm
> will be making a retroactive change to SVE to remove the possibility of
> selecting non power of two vector lengths. This has no impact on existing
> physical implementations but most virtual implementations have implemented
> the full range of permissible vector lengths. Given how demanding fp-stress
> is for these implementations update to only attempt to enumerate the power
> of two vector lengths, reducing the load created on existing virtual
> implementations and only exercising the functionality that will be seen in
> physical implementations.
> 
> [...]

Applied to arm64 (for-next/kselftest), thanks!

[1/1] kselftest/arm64: Skip non-power of 2 SVE vector lengths in fp-stress
      https://git.kernel.org/arm64/c/67f49869106f
diff mbox series

Patch

diff --git a/tools/testing/selftests/arm64/fp/fp-stress.c b/tools/testing/selftests/arm64/fp/fp-stress.c
index f8b2f41aac36..2b95f9451b1b 100644
--- a/tools/testing/selftests/arm64/fp/fp-stress.c
+++ b/tools/testing/selftests/arm64/fp/fp-stress.c
@@ -377,7 +377,7 @@  static void probe_vls(int vls[], int *vl_count, int set_vl)
 
 	*vl_count = 0;
 
-	for (vq = SVE_VQ_MAX; vq > 0; --vq) {
+	for (vq = SVE_VQ_MAX; vq > 0; vq /= 2) {
 		vl = prctl(set_vl, vq * 16);
 		if (vl == -1)
 			ksft_exit_fail_msg("SET_VL failed: %s (%d)\n",
@@ -385,6 +385,9 @@  static void probe_vls(int vls[], int *vl_count, int set_vl)
 
 		vl &= PR_SVE_VL_LEN_MASK;
 
+		if (*vl_count && (vl == vls[*vl_count - 1]))
+			break;
+
 		vq = sve_vq_from_vl(vl);
 
 		vls[*vl_count] = vl;