Skip to content
Commit b7c510d0 authored by Mark Brown's avatar Mark Brown Committed by Will Deacon
Browse files

arm64/ptrace: Don't flush ZA/ZT storage when writing ZA via ptrace



When writing ZA we currently unconditionally flush the buffer used to store
it as part of ensuring that it is allocated. Since this buffer is shared
with ZT0 this means that a write to ZA when PSTATE.ZA is already set will
corrupt the value of ZT0 on a SME2 system. Fix this by only flushing the
backing storage if PSTATE.ZA was not previously set.

This will mean that short or failed writes may leave stale data in the
buffer, this seems as correct as our current behaviour and unlikely to be
something that userspace will rely on.

Fixes: f90b529b ("arm64/sme: Implement ZT0 ptrace support")
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20240115-arm64-fix-ptrace-za-zt-v1-1-48617517028a@kernel.org


Signed-off-by: default avatarWill Deacon <will@kernel.org>
parent da59f1d0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment