plan9fox/sys
cinap_lenrek 4f27f6a04f pc64: allow using the FPU in syscall and pagefault handlers
The aim is to take advantage of SSE instructions such as AES-NI
in the kernel by lazily saving and restoring FPU state across
system calls and pagefaults. (everything can can do I/O)

This is accomplished by the functions fpusave() and fpurestore().

fpusave() remembers the current state and disables the FPU if it
was active by setting the TS flag. In case the FPU gets used,
the current state gets saved and a new PFPU.fpslot is allocated
by mathemu().

fpurestore() restores the previous FPU state, reenabling the FPU
if fpusave() disabled it.

In the most common case, when userspace is not using the FPU,
then fpusave()/fpurestore() just toggle the FPpush bit in
up->fpstate.

When the FPU was active, but we do not use the FPU, then nothing
needs to be saved or restored. We just switched the TS flag on
and off agaian.

Note, this is done for the amd64 kernel only.
2017-11-12 22:55:54 +01:00
..
doc /sys/doc: fix mkfile to and remove files that now can be regenerated 2017-05-09 16:23:48 +02:00
games/lib fortunes: does that me a dipshit 2016-10-16 14:16:17 -04:00
include libsec: rewrite aex_xts_encrypt()/aes_xts_decrypt() 2017-10-29 21:49:24 +01:00
lib hgwebfs: simplify retry loop construction 2017-10-04 05:06:54 +02:00
man tinc(8): mash -> mesh 2017-11-02 09:05:03 +01:00
src pc64: allow using the FPU in syscall and pagefault handlers 2017-11-12 22:55:54 +01:00