linux/arch/sparc/lib
David S. Miller f4da3628dc sparc64: Fix FPU register corruption with AES crypto offload.
The AES loops in arch/sparc/crypto/aes_glue.c use a scheme where the
key material is preloaded into the FPU registers, and then we loop
over and over doing the crypt operation, reusing those pre-cooked key
registers.

There are intervening blkcipher*() calls between the crypt operation
calls.  And those might perform memcpy() and thus also try to use the
FPU.

The sparc64 kernel FPU usage mechanism is designed to allow such
recursive uses, but with a catch.

There has to be a trap between the two FPU using threads of control.

The mechanism works by, when the FPU is already in use by the kernel,
allocating a slot for FPU saving at trap time.  Then if, within the
trap handler, we try to use the FPU registers, the pre-trap FPU
register state is saved into the slot.  Then at trap return time we
notice this and restore the pre-trap FPU state.

Over the long term there are various more involved ways we can make
this work, but for a quick fix let's take advantage of the fact that
the situation where this happens is very limited.

All sparc64 chips that support the crypto instructiosn also are using
the Niagara4 memcpy routine, and that routine only uses the FPU for
large copies where we can't get the source aligned properly to a
multiple of 8 bytes.

We look to see if the FPU is already in use in this context, and if so
we use the non-large copy path which only uses integer registers.

Furthermore, we also limit this special logic to when we are doing
kernel copy, rather than a user copy.

Signed-off-by: David S. Miller <davem@davemloft.net>
2014-10-14 19:37:58 -07:00
..
ashldi3.S
ashrdi3.S
atomic32.c locking,arch,sparc: Fold atomic_ops 2014-08-14 12:48:13 +02:00
atomic_64.S locking, sparc64: Fix atomics 2014-09-10 11:45:04 +02:00
bitext.c sparc/srmmu: clear trailing edge of bitmap properly 2013-03-31 19:29:12 -04:00
bitops.S
blockops.S
bzero.S
checksum_32.S
checksum_64.S
clear_page.S sparc64: Make PAGE_OFFSET variable. 2013-11-12 15:22:34 -08:00
cmpdi2.c
copy_in_user.S
copy_page.S sparc64: Make PAGE_OFFSET variable. 2013-11-12 15:22:34 -08:00
copy_user.S
COPYING.LIB
csum_copy_from_user.S
csum_copy_to_user.S
csum_copy.S
divdi3.S
ffs.S
GENbzero.S
GENcopy_from_user.S
GENcopy_to_user.S
GENmemcpy.S
GENpage.S
GENpatch.S
hweight.S
iomap.c
ipcsum.S
ksyms.c locking,arch,sparc: Fold atomic_ops 2014-08-14 12:48:13 +02:00
libgcc.h
locks.S
lshrdi3.S
Makefile sparc32: introduce asm-generic/io.h 2014-05-02 01:30:21 -04:00
mcount.S sparc64,ftrace: Remove check of obsolete variable function_trace_stop 2014-07-18 13:57:03 -04:00
memcmp.S
memcpy.S
memmove.S
memscan_32.S
memscan_64.S
memset.S sparc: Let memset return the address argument 2014-09-09 16:38:10 -07:00
muldi3.S
NG2copy_from_user.S
NG2copy_to_user.S
NG2memcpy.S sparc64: Add membar to Niagara2 memcpy code. 2014-05-17 11:28:05 -07:00
NG2patch.S
NG4clear_page.S sparc64: Niagara-4 bzero/memset, plus use MRU stores in page copy. 2012-10-05 13:45:26 -07:00
NG4copy_from_user.S sparc64: Fix comment type in NG4 copy from user. 2012-09-27 14:26:41 -07:00
NG4copy_page.S sparc64: Niagara-4 bzero/memset, plus use MRU stores in page copy. 2012-10-05 13:45:26 -07:00
NG4copy_to_user.S sparc64: Add SPARC-T4 optimized memcpy. 2012-09-27 00:35:11 -07:00
NG4memcpy.S sparc64: Fix FPU register corruption with AES crypto offload. 2014-10-14 19:37:58 -07:00
NG4memset.S sparc64: Niagara-4 bzero/memset, plus use MRU stores in page copy. 2012-10-05 13:45:26 -07:00
NG4patch.S sparc64: Niagara-4 bzero/memset, plus use MRU stores in page copy. 2012-10-05 13:45:26 -07:00
NGbzero.S
NGcopy_from_user.S
NGcopy_to_user.S
NGmemcpy.S
NGpage.S sparc64: Add SPARC-T4 optimized memcpy. 2012-09-27 00:35:11 -07:00
NGpatch.S
PeeCeeI.c sparc64: update IO access functions in PeeCeeI 2014-07-21 21:43:18 -07:00
strlen.S
strncmp_32.S
strncmp_64.S
U1copy_from_user.S
U1copy_to_user.S
U1memcpy.S sparc64: Consistently use fsrc2 rather than fmovd in optimized asm. 2012-06-27 01:25:23 -07:00
U3copy_from_user.S
U3copy_to_user.S
U3memcpy.S
U3patch.S
ucmpdi2.c
udivdi3.S
user_fixup.c
VISsave.S
xor.S