linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] arm64: Fix support for systems without FP/SIMD
@ 2019-10-10 17:15 Suzuki K Poulose
  2019-10-10 17:15 ` [PATCH 1/3] arm64: cpufeature: Fix the type of no FP/SIMD capability Suzuki K Poulose
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Suzuki K Poulose @ 2019-10-10 17:15 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, will, mark.rutland, catalin.marinas, dave.martin,
	Suzuki K Poulose

This series fixes the original support for systems without FP/SIMD.
We have three set of issues with the current code :

1) We detect the absence of FP/SIMD after the SMP cpus are brought
online (i.e, SYSTEM scope). This means, some of the early kernel threads
could run with their TIF_FOREIGN_FPSTATE flag set which might be
inherited by applications forked by them (e.g, modprobe from initramfs).

Also we allow a hotplugged CPU to boot successfully even if it doesn't
have the FP/SIMD when we have decided otherwise at boot and have now
advertised the ELF HWCAP for the userspace.
Fix this by turning this to a BOOT_RESTRICTED_CPU_LOCAL feature to
allow the detection of the feature the very moment a CPU turns up
without FP/SIMD and also prevent a conflict after SMP boot.

2) As mentioned above, some tasks could have the TIF flag set,
which will never be cleared after we detect the capability.
Thus they could get stuck indefinitely in do_notfiy_resume().
Fix this by clearing the TIF flag for such tasks but continuing
to avoid the save/restore of the FP state.

3) The compat ELF_HWCAP bits are statically initialised to indicate
that the FP/SIMD support is available. This must be updated dynamically
to provide the correct flags to the userspace.

Tested with a 32bit Debian Jessie fs on Fast model (with and without
FP support).

Suzuki K Poulose (3):
  arm64: cpufeature: Fix the type of no FP/SIMD capability
  arm64: nofpsmid: Clear TIF_FOREIGN_FPSTATE flag for early tasks
  arm64: cpufeature: Set the FP/SIMD compat HWCAP bits properly

 arch/arm64/kernel/cpufeature.c | 39 ++++++++++++++++++++++++++++++----
 arch/arm64/kernel/fpsimd.c     | 26 ++++++++++++++---------
 2 files changed, 51 insertions(+), 14 deletions(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2019-10-17 16:09 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 17:15 [PATCH 0/3] arm64: Fix support for systems without FP/SIMD Suzuki K Poulose
2019-10-10 17:15 ` [PATCH 1/3] arm64: cpufeature: Fix the type of no FP/SIMD capability Suzuki K Poulose
2019-10-11 11:36   ` Dave Martin
2019-10-11 12:13     ` Suzuki K Poulose
2019-10-11 14:21       ` Dave Martin
2019-10-11 17:28         ` Suzuki K Poulose
2019-10-14 14:52           ` Dave Martin
2019-10-14 15:45             ` Suzuki K Poulose
2019-10-14 15:50               ` Dave P Martin
2019-10-14 16:57                 ` Ard Biesheuvel
2019-10-15  9:44                   ` Suzuki K Poulose
2019-10-15  9:52                     ` Ard Biesheuvel
2019-10-15 10:24                   ` Dave Martin
2019-10-15 10:30                     ` Ard Biesheuvel
2019-10-15 13:03                       ` Suzuki K Poulose
2019-10-15 13:11                         ` Ard Biesheuvel
2019-10-15 14:05                       ` Dave Martin
2019-10-10 17:15 ` [PATCH 2/3] arm64: nofpsmid: Clear TIF_FOREIGN_FPSTATE flag for early tasks Suzuki K Poulose
2019-10-11 11:26   ` Dave Martin
2019-10-17 12:42     ` Suzuki K Poulose
2019-10-17 16:09       ` Dave Martin
2019-10-10 17:15 ` [PATCH 3/3] arm64: cpufeature: Set the FP/SIMD compat HWCAP bits properly Suzuki K Poulose
2019-10-17  0:06 ` [PATCH 0/3] arm64: Fix support for systems without FP/SIMD Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).