]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
sparc64: Don't restrict fp regs for no-fault loads
authorRob Gardner <rob.gardner@oracle.com>
Sat, 31 Oct 2015 04:36:23 +0000 (22:36 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Nov 2015 20:00:49 +0000 (15:00 -0500)
commitcae9af6a820b47d3e5e0da4edf23cf6fa69b18d8
tree2fbeac9dfdcb152b65dda84aaf7331d53a291bce
parentd618382ba5f1a4905db63f4980bf7b0a5826de9d
sparc64: Don't restrict fp regs for no-fault loads

The function handle_ldf_stq() deals with no-fault ASI
loads and stores, but restricts fp registers to quad
word regs (ie, %f0, %f4 etc). This is valid for the
STQ case, but unnecessarily restricts loads, which
may be single precision, double, or quad. This results
in SIGFPE being raised for this instruction when the
source address is invalid:
ldda [%g1] ASI_PNF, %f2
but not for this one:
ldda [%g1] ASI_PNF, %f4
The validation check for quad register is moved to
within the STQ block so that loads are not affected
by the check.

An additional problem is that the calculation for freg
is incorrect when a single precision load is being
handled. This causes %f1 to be seen as %f32 etc,
and the incorrect register ends up being overwritten.
This code sequence demonstrates the problem:
ldd [%g1], %f32 ! g1 = valid address
lda [%i3] ASI_PNF, %f1  ! i3 = invalid address
std %f32, [%g1]
This is corrected by basing the freg calculation on
the load size.

Signed-off-by: Rob Gardner <rob.gardner@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/unaligned_64.c