Mark Rutland's recent SME fixes updated the SME ABI to reject any attempt to write FPSIMD register data via the streaming mode SVE register set but did not update the sve-ptrace test to take account of this, resulting in spurious failures. Update the test for this, and also fix another preexisting issue I noticed while looking at this.
Signed-off-by: Mark Brown broonie@kernel.org --- Mark Brown (3): kselftest/arm64: Fix check for setting new VLs in sve-ptrace kselftest/arm64: Fix test for streaming FPSIMD write in sve-ptrace kselftest/arm64: Specify SVE data when testing VL set in sve-ptrace
tools/testing/selftests/arm64/fp/sve-ptrace.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- base-commit: 1c1abfd151c824698830ee900cc8d9f62e9a5fbb change-id: 20250523-kselftest-arm64-ssve-fixups-b68ae61c1ebf
Best regards,
The check that the new vector length we set was the expected one was typoed to an assignment statement which for some reason the compilers didn't spot, most likely due to the macros involved.
Fixes: 0dca276ac4d2 ("selftests: arm64: Add test for the SVE ptrace interface") Signed-off-by: Mark Brown broonie@kernel.org --- tools/testing/selftests/arm64/fp/sve-ptrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/arm64/fp/sve-ptrace.c b/tools/testing/selftests/arm64/fp/sve-ptrace.c index 577b6e05e860..c499d5789dd5 100644 --- a/tools/testing/selftests/arm64/fp/sve-ptrace.c +++ b/tools/testing/selftests/arm64/fp/sve-ptrace.c @@ -253,7 +253,7 @@ static void ptrace_set_get_vl(pid_t child, const struct vec_type *type, return; }
- ksft_test_result(new_sve->vl = prctl_vl, "Set %s VL %u\n", + ksft_test_result(new_sve->vl == prctl_vl, "Set %s VL %u\n", type->name, vl);
free(new_sve);
On Fri, May 23, 2025 at 04:27:12PM +0100, Mark Brown wrote:
The check that the new vector length we set was the expected one was typoed to an assignment statement which for some reason the compilers didn't spot, most likely due to the macros involved.
Fixes: 0dca276ac4d2 ("selftests: arm64: Add test for the SVE ptrace interface")
I don't think that fixes tag is correct. AFAICT, this code was introduced in commit:
a1d7111257cd ("selftests: arm64: More comprehensively test the SVE ptrace interface")
... and there wasn't something equivalent prior to that.
With that fixed:
Acked-by: Mark Rutland mark.rutland@arm.com
Mark.
Signed-off-by: Mark Brown broonie@kernel.org
tools/testing/selftests/arm64/fp/sve-ptrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/arm64/fp/sve-ptrace.c b/tools/testing/selftests/arm64/fp/sve-ptrace.c index 577b6e05e860..c499d5789dd5 100644 --- a/tools/testing/selftests/arm64/fp/sve-ptrace.c +++ b/tools/testing/selftests/arm64/fp/sve-ptrace.c @@ -253,7 +253,7 @@ static void ptrace_set_get_vl(pid_t child, const struct vec_type *type, return; }
- ksft_test_result(new_sve->vl = prctl_vl, "Set %s VL %u\n",
- ksft_test_result(new_sve->vl == prctl_vl, "Set %s VL %u\n", type->name, vl);
free(new_sve);
-- 2.39.5
On 23/05/25 8:57 pm, Mark Brown wrote:
The check that the new vector length we set was the expected one was typoed to an assignment statement which for some reason the compilers didn't spot, most likely due to the macros involved.
Fixes: 0dca276ac4d2 ("selftests: arm64: Add test for the SVE ptrace interface") Signed-off-by: Mark Brown broonie@kernel.org
Acked-by: Dev Jain dev.jain@arm.com
Since f916dd32a943 ("arm64/fpsimd: ptrace: Mandate SVE payload for streaming-mode state") we do not support writing FPSIMD payload data when writing NT_ARM_SSVE but the sve-ptrace test has an explicit test for this being supported which was not updated to reflect the new behaviour. Fix the test to expect a failure when writing FPSIMD data to the streaming mode register set.
Signed-off-by: Mark Brown broonie@kernel.org --- tools/testing/selftests/arm64/fp/sve-ptrace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/arm64/fp/sve-ptrace.c b/tools/testing/selftests/arm64/fp/sve-ptrace.c index c499d5789dd5..7e259907805b 100644 --- a/tools/testing/selftests/arm64/fp/sve-ptrace.c +++ b/tools/testing/selftests/arm64/fp/sve-ptrace.c @@ -301,8 +301,10 @@ static void ptrace_sve_fpsimd(pid_t child, const struct vec_type *type) p[j] = j; }
+ /* This should only succeed for SVE */ ret = set_sve(child, type, sve); - ksft_test_result(ret == 0, "%s FPSIMD set via SVE: %d\n", + ksft_test_result((type->regset == NT_ARM_SVE) == (ret == 0), + "%s FPSIMD set via SVE: %d\n", type->name, ret); if (ret) goto out;
On Fri, May 23, 2025 at 04:27:13PM +0100, Mark Brown wrote:
Since f916dd32a943 ("arm64/fpsimd: ptrace: Mandate SVE payload for streaming-mode state") we do not support writing FPSIMD payload data when writing NT_ARM_SSVE but the sve-ptrace test has an explicit test for this being supported which was not updated to reflect the new behaviour. Fix the test to expect a failure when writing FPSIMD data to the streaming mode register set.
Signed-off-by: Mark Brown broonie@kernel.org
Acked-by: Mark Rutland mark.rutland@arm.com
Mark.
tools/testing/selftests/arm64/fp/sve-ptrace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/arm64/fp/sve-ptrace.c b/tools/testing/selftests/arm64/fp/sve-ptrace.c index c499d5789dd5..7e259907805b 100644 --- a/tools/testing/selftests/arm64/fp/sve-ptrace.c +++ b/tools/testing/selftests/arm64/fp/sve-ptrace.c @@ -301,8 +301,10 @@ static void ptrace_sve_fpsimd(pid_t child, const struct vec_type *type) p[j] = j; }
- /* This should only succeed for SVE */ ret = set_sve(child, type, sve);
- ksft_test_result(ret == 0, "%s FPSIMD set via SVE: %d\n",
- ksft_test_result((type->regset == NT_ARM_SVE) == (ret == 0),
if (ret) goto out;"%s FPSIMD set via SVE: %d\n", type->name, ret);
-- 2.39.5
Since f916dd32a943 ("arm64/fpsimd: ptrace: Mandate SVE payload for streaming-mode state") we reject attempts to write to the streaming mode regset even if there is no register data supplied, causing the tests for setting vector lengths and setting SVE_VL_INHERIT in sve-ptrace to spuriously fail. Set the flag to avoid the issue, we still support not supplying register data.
Signed-off-by: Mark Brown broonie@kernel.org --- tools/testing/selftests/arm64/fp/sve-ptrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/arm64/fp/sve-ptrace.c b/tools/testing/selftests/arm64/fp/sve-ptrace.c index 7e259907805b..7f9b6a61d369 100644 --- a/tools/testing/selftests/arm64/fp/sve-ptrace.c +++ b/tools/testing/selftests/arm64/fp/sve-ptrace.c @@ -170,7 +170,7 @@ static void ptrace_set_get_inherit(pid_t child, const struct vec_type *type) memset(&sve, 0, sizeof(sve)); sve.size = sizeof(sve); sve.vl = sve_vl_from_vq(SVE_VQ_MIN); - sve.flags = SVE_PT_VL_INHERIT; + sve.flags = SVE_PT_VL_INHERIT | SVE_PT_REGS_SVE; ret = set_sve(child, type, &sve); if (ret != 0) { ksft_test_result_fail("Failed to set %s SVE_PT_VL_INHERIT\n", @@ -235,6 +235,7 @@ static void ptrace_set_get_vl(pid_t child, const struct vec_type *type, /* Set the VL by doing a set with no register payload */ memset(&sve, 0, sizeof(sve)); sve.size = sizeof(sve); + sve.flags = SVE_PT_REGS_SVE; sve.vl = vl; ret = set_sve(child, type, &sve); if (ret != 0) {
On Fri, May 23, 2025 at 04:27:14PM +0100, Mark Brown wrote:
Since f916dd32a943 ("arm64/fpsimd: ptrace: Mandate SVE payload for streaming-mode state") we reject attempts to write to the streaming mode regset even if there is no register data supplied, causing the tests for setting vector lengths and setting SVE_VL_INHERIT in sve-ptrace to spuriously fail. Set the flag to avoid the issue, we still support not supplying register data.
Signed-off-by: Mark Brown broonie@kernel.org
Acked-by: Mark Rutland mark.rutland@arm.com
Mark.
tools/testing/selftests/arm64/fp/sve-ptrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/arm64/fp/sve-ptrace.c b/tools/testing/selftests/arm64/fp/sve-ptrace.c index 7e259907805b..7f9b6a61d369 100644 --- a/tools/testing/selftests/arm64/fp/sve-ptrace.c +++ b/tools/testing/selftests/arm64/fp/sve-ptrace.c @@ -170,7 +170,7 @@ static void ptrace_set_get_inherit(pid_t child, const struct vec_type *type) memset(&sve, 0, sizeof(sve)); sve.size = sizeof(sve); sve.vl = sve_vl_from_vq(SVE_VQ_MIN);
- sve.flags = SVE_PT_VL_INHERIT;
- sve.flags = SVE_PT_VL_INHERIT | SVE_PT_REGS_SVE; ret = set_sve(child, type, &sve); if (ret != 0) { ksft_test_result_fail("Failed to set %s SVE_PT_VL_INHERIT\n",
@@ -235,6 +235,7 @@ static void ptrace_set_get_vl(pid_t child, const struct vec_type *type, /* Set the VL by doing a set with no register payload */ memset(&sve, 0, sizeof(sve)); sve.size = sizeof(sve);
- sve.flags = SVE_PT_REGS_SVE; sve.vl = vl; ret = set_sve(child, type, &sve); if (ret != 0) {
-- 2.39.5
On Fri, May 23, 2025 at 04:27:11PM +0100, Mark Brown wrote:
Mark Rutland's recent SME fixes updated the SME ABI to reject any attempt to write FPSIMD register data via the streaming mode SVE register set but did not update the sve-ptrace test to take account of this, resulting in spurious failures. Update the test for this, and also fix another preexisting issue I noticed while looking at this.
For the sake of the mail archive, that series of fixes was:
https://lore.kernel.org/linux-arm-kernel/20250508132644.1395904-1-mark.rutla...
Evidently I only fixed up the fpsimd-ptrace tests, and missed the sve-ptrace tests. My bad; sorry about that.
Mark.
Signed-off-by: Mark Brown broonie@kernel.org
Mark Brown (3): kselftest/arm64: Fix check for setting new VLs in sve-ptrace kselftest/arm64: Fix test for streaming FPSIMD write in sve-ptrace kselftest/arm64: Specify SVE data when testing VL set in sve-ptrace
tools/testing/selftests/arm64/fp/sve-ptrace.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
base-commit: 1c1abfd151c824698830ee900cc8d9f62e9a5fbb change-id: 20250523-kselftest-arm64-ssve-fixups-b68ae61c1ebf
Best regards,
Mark Brown broonie@kernel.org
linux-kselftest-mirror@lists.linaro.org