Skip to content

Commit 864f3dd

Browse files
mrutland-armwilldeacon
authored andcommitted
kselftest/arm64: fp-ptrace: Adjust to new inactive mode behaviour
In order to fix an ABI problem, we recently changed the way that reads of the NT_ARM_SVE and NT_ARM_SSVE regsets behave when their corresponding vector state is inactive. Update the fp-ptrace test for the new behaviour. Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: David Spickett <david.spickett@arm.com> Cc: Luis Machado <luis.machado@arm.com> Cc: Marc Zyngier <maz@kernel.org> Cc: Mark Brown <broonie@kernel.org> Cc: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/20250508132644.1395904-25-mark.rutland@arm.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 031a2ac commit 864f3dd

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

tools/testing/selftests/arm64/fp/fp-ptrace.c

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,17 @@ static bool check_ptrace_values_sve(pid_t child, struct test_config *config)
439439
pass = false;
440440
}
441441

442-
if (sve->size != SVE_PT_SIZE(vq, sve->flags)) {
443-
ksft_print_msg("Mismatch in SVE header size: %d != %lu\n",
444-
sve->size, SVE_PT_SIZE(vq, sve->flags));
445-
pass = false;
442+
if (svcr_in & SVCR_SM) {
443+
if (sve->size != sizeof(sve)) {
444+
ksft_print_msg("NT_ARM_SVE reports data with PSTATE.SM\n");
445+
pass = false;
446+
}
447+
} else {
448+
if (sve->size != SVE_PT_SIZE(vq, sve->flags)) {
449+
ksft_print_msg("Mismatch in SVE header size: %d != %lu\n",
450+
sve->size, SVE_PT_SIZE(vq, sve->flags));
451+
pass = false;
452+
}
446453
}
447454

448455
/* The registers might be in completely different formats! */
@@ -515,10 +522,17 @@ static bool check_ptrace_values_ssve(pid_t child, struct test_config *config)
515522
pass = false;
516523
}
517524

518-
if (sve->size != SVE_PT_SIZE(vq, sve->flags)) {
519-
ksft_print_msg("Mismatch in SSVE header size: %d != %lu\n",
520-
sve->size, SVE_PT_SIZE(vq, sve->flags));
521-
pass = false;
525+
if (!(svcr_in & SVCR_SM)) {
526+
if (sve->size != sizeof(sve)) {
527+
ksft_print_msg("NT_ARM_SSVE reports data without PSTATE.SM\n");
528+
pass = false;
529+
}
530+
} else {
531+
if (sve->size != SVE_PT_SIZE(vq, sve->flags)) {
532+
ksft_print_msg("Mismatch in SSVE header size: %d != %lu\n",
533+
sve->size, SVE_PT_SIZE(vq, sve->flags));
534+
pass = false;
535+
}
522536
}
523537

524538
/* The registers might be in completely different formats! */

0 commit comments

Comments
 (0)