| From 102a6acfd11d042c99dea326c71e9efa957b6bff Mon Sep 17 00:00:00 2001 |
| From: Sasha Levin <sashal@kernel.org> |
| Date: Mon, 9 Jun 2025 16:25:33 +0100 |
| Subject: kselftest/arm64: Specify SVE data when testing VL set in sve-ptrace |
| |
| From: Mark Brown <broonie@kernel.org> |
| |
| [ Upstream commit 9e8ebfe677f9101bbfe1f75d548a5aec581e8213 ] |
| |
| 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. |
| |
| Acked-by: Mark Rutland <mark.rutland@arm.com> |
| Signed-off-by: Mark Brown <broonie@kernel.org> |
| Link: https://lore.kernel.org/r/20250609-kselftest-arm64-ssve-fixups-v2-3-998fcfa6f240@kernel.org |
| Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> |
| Signed-off-by: Sasha Levin <sashal@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 c6228176dd1a..408fb1c5c2f8 100644 |
| --- a/tools/testing/selftests/arm64/fp/sve-ptrace.c |
| +++ b/tools/testing/selftests/arm64/fp/sve-ptrace.c |
| @@ -168,7 +168,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", |
| @@ -233,6 +233,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 |
| |