FROMGIT: arm64/fpsimd: Reset FPMR upon exec()
An exec() is expected to reset all FPSIMD/SVE/SME state, and barring
special handling of the vector lengths, the state is expected to reset
to zero. This reset is handled in fpsimd_flush_thread(), which the core
exec() code calls via flush_thread().
When support was added for FPMR, no logic was added to
fpsimd_flush_thread() to reset the FPMR value, and thus it is
erroneously inherited across an exec().
Add the missing reset of FPMR.
Fixes: 203f2b95a8 ("arm64/fpsimd: Support FEAT_FPMR")
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20250409164010.3480271-9-mark.rutland@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit a90878f297d3dba906a6261deccb1bd4a791ba52
https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
for-next/sme-fixes)
Bug: 393087661
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Icc2a8470827be2f0703db964e51ecda2648f9b11
This commit is contained in:
committed by
Will Deacon
parent
32dbf4add0
commit
f78acfcc31
@@ -1638,6 +1638,9 @@ void fpsimd_flush_thread(void)
|
||||
current->thread.svcr = 0;
|
||||
}
|
||||
|
||||
if (system_supports_fpmr())
|
||||
current->thread.uw.fpmr = 0;
|
||||
|
||||
current->thread.fp_type = FP_STATE_FPSIMD;
|
||||
|
||||
put_cpu_fpsimd_context();
|
||||
|
||||
Reference in New Issue
Block a user