Skip to content

Commit 031a2ac

Browse files
mrutland-armwilldeacon
authored andcommitted
kselftest/arm64: fp-ptrace: Adjust to new VL change behaviour
In order to fix an ABI problem, we recently changed the way that changing the SVE/SME vector length affects PSTATE.SM. Historically, changing the SME vector length would clear PSTATE.SM. Now, changing the SME vector length preserves PSTATE.SM. Update the fp-ptrace test for the new behaviour. Signed-off-by: Mark Rutland <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: David Spickett <[email protected]> Cc: Luis Machado <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Mark Brown <[email protected]> Cc: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent be45e63 commit 031a2ac

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

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

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,18 +1183,8 @@ static void sve_write(pid_t child, struct test_config *config)
11831183

11841184
static bool za_write_supported(struct test_config *config)
11851185
{
1186-
if (config->sme_vl_in != config->sme_vl_expected) {
1187-
/* Changing the SME VL exits streaming mode. */
1188-
if (config->svcr_expected & SVCR_SM) {
1189-
return false;
1190-
}
1191-
} else {
1192-
/* Otherwise we can't change streaming mode */
1193-
if ((config->svcr_in & SVCR_SM) !=
1194-
(config->svcr_expected & SVCR_SM)) {
1195-
return false;
1196-
}
1197-
}
1186+
if ((config->svcr_in & SVCR_SM) != (config->svcr_expected & SVCR_SM))
1187+
return false;
11981188

11991189
return true;
12001190
}
@@ -1212,10 +1202,8 @@ static void za_write_expected(struct test_config *config)
12121202
memset(zt_expected, 0, sizeof(zt_expected));
12131203
}
12141204

1215-
/* Changing the SME VL flushes ZT, SVE state and exits SM */
1205+
/* Changing the SME VL flushes ZT, SVE state */
12161206
if (config->sme_vl_in != config->sme_vl_expected) {
1217-
svcr_expected &= ~SVCR_SM;
1218-
12191207
sve_vq = __sve_vq_from_vl(vl_expected(config));
12201208
memset(z_expected, 0, __SVE_ZREGS_SIZE(sve_vq));
12211209
memset(p_expected, 0, __SVE_PREGS_SIZE(sve_vq));

0 commit comments

Comments
 (0)