Commit 864f3ddc authored by Mark Rutland's avatar Mark Rutland Committed by Will Deacon
Browse files

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: default avatarMark 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: default avatarWill Deacon <will@kernel.org>
parent 031a2aca
Loading
Loading
Loading
Loading
+22 −8
Original line number Diff line number Diff line
@@ -439,11 +439,18 @@ static bool check_ptrace_values_sve(pid_t child, struct test_config *config)
		pass = false;
	}

	if (svcr_in & SVCR_SM) {
		if (sve->size != sizeof(sve)) {
			ksft_print_msg("NT_ARM_SVE reports data with PSTATE.SM\n");
			pass = false;
		}
	} else {
		if (sve->size != SVE_PT_SIZE(vq, sve->flags)) {
			ksft_print_msg("Mismatch in SVE header size: %d != %lu\n",
				       sve->size, SVE_PT_SIZE(vq, sve->flags));
			pass = false;
		}
	}

	/* The registers might be in completely different formats! */
	if (sve->flags & SVE_PT_REGS_SVE) {
@@ -515,11 +522,18 @@ static bool check_ptrace_values_ssve(pid_t child, struct test_config *config)
		pass = false;
	}

	if (!(svcr_in & SVCR_SM)) {
		if (sve->size != sizeof(sve)) {
			ksft_print_msg("NT_ARM_SSVE reports data without PSTATE.SM\n");
			pass = false;
		}
	} else {
		if (sve->size != SVE_PT_SIZE(vq, sve->flags)) {
			ksft_print_msg("Mismatch in SSVE header size: %d != %lu\n",
				       sve->size, SVE_PT_SIZE(vq, sve->flags));
			pass = false;
		}
	}

	/* The registers might be in completely different formats! */
	if (sve->flags & SVE_PT_REGS_SVE) {