Skip to content

Commit 7e9c5b0

Browse files
brooniectmarinas
authored andcommitted
kselftest/arm64: Expand the set of ZA writes fp-ptrace does
Currently our test for implementable ZA writes is written in a bit of a convoluted fashion which excludes all changes where we clear SVCR.SM even though we can actually support that since changing the vector length resets SVCR. Make the logic more direct, enabling us to actually run these cases. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20241112-arm64-fp-ptrace-fpmr-v2-2-250b57c61254@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent c035007 commit 7e9c5b0

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,21 +1078,19 @@ static void sve_write(pid_t child, struct test_config *config)
10781078

10791079
static bool za_write_supported(struct test_config *config)
10801080
{
1081-
if (config->svcr_expected & SVCR_SM) {
1082-
if (!(config->svcr_in & SVCR_SM))
1081+
if (config->sme_vl_in != config->sme_vl_expected) {
1082+
/* Changing the SME VL exits streaming mode. */
1083+
if (config->svcr_expected & SVCR_SM) {
10831084
return false;
1084-
1085-
/* Changing the SME VL exits streaming mode */
1086-
if (config->sme_vl_in != config->sme_vl_expected) {
1085+
}
1086+
} else {
1087+
/* Otherwise we can't change streaming mode */
1088+
if ((config->svcr_in & SVCR_SM) !=
1089+
(config->svcr_expected & SVCR_SM)) {
10871090
return false;
10881091
}
10891092
}
10901093

1091-
/* Can't disable SM outside a VL change */
1092-
if ((config->svcr_in & SVCR_SM) &&
1093-
!(config->svcr_expected & SVCR_SM))
1094-
return false;
1095-
10961094
return true;
10971095
}
10981096

0 commit comments

Comments
 (0)