linux/arch/openrisc
Stafford Horne 4dc70e1aad openrisc: Move FPU state out of pt_regs
My original, naive, FPU support patch had the FPCSR register stored
during both the *mode switch* and *context switch*.  This is wasteful.

Also, the original patches did not save the FPU state when handling
signals during the system call fast path.

We fix this by moving the FPCSR state to thread_struct in task_struct.
We also introduce new helper functions save_fpu and restore_fpu which
can be used to sync the FPU with thread_struct.  These functions are now
called when needed:

 - Setting up and restoring sigcontext when handling signals
 - Before and after __switch_to during context switches
 - When handling FPU exceptions
 - When reading and writing FPU register sets

In the future we can further optimize this by doing lazy FPU save and
restore.  For example, FPU sync is not needed when switching to and from
kernel threads (x86 does this).  FPU save and restore does not need to
be done two times if we have both rescheduling and signal work to do.
However, since OpenRISC FPU state is a single register, I leave these
optimizations for future consideration.

Signed-off-by: Stafford Horne <shorne@gmail.com>
2024-04-15 15:20:39 +01:00
..
boot kbuild: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00
configs treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
include openrisc: Move FPU state out of pt_regs 2024-04-15 15:20:39 +01:00
kernel openrisc: Move FPU state out of pt_regs 2024-04-15 15:20:39 +01:00
lib openrisc/delay: Add include to fix symbol not declared warning 2022-05-23 17:15:49 +09:00
mm OpenRISC updates for 6.6 2023-09-05 10:09:31 -07:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig openrisc: Add FPU config 2024-04-15 15:20:39 +01:00
Kconfig.debug treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile kbuild: remove head-y syntax 2022-10-02 18:06:03 +09:00