Commit c3cdd54c authored by Mark Brown's avatar Mark Brown Committed by Catalin Marinas
Browse files

arm64/ptrace: Use system_supports_tpidr2() to check for TPIDR2 support



We have a separate system_supports_tpidr2() to check for TPIDR2 support
but were using system_supports_sme() in tls_set(). While these are
currently identical let's use the specific check instead so we don't have
any surprises in future.

Reported-by: default avatarWill Deacon <will@kernel.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20221208-arm64-tpidr2-ptrace-feat-v2-1-3760c895a574@kernel.org


Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent b7bfaa76
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -683,7 +683,7 @@ static int tls_set(struct task_struct *target, const struct user_regset *regset,
	unsigned long tls[2];

	tls[0] = target->thread.uw.tp_value;
	if (system_supports_sme())
	if (system_supports_tpidr2())
		tls[1] = target->thread.tpidr2_el0;

	ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, tls, 0, count);
@@ -691,7 +691,7 @@ static int tls_set(struct task_struct *target, const struct user_regset *regset,
		return ret;

	target->thread.uw.tp_value = tls[0];
	if (system_supports_sme())
	if (system_supports_tpidr2())
		target->thread.tpidr2_el0 = tls[1];

	return ret;