]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
[IA64] Fix unaligned handler for floating point instructions with base update
authorTony Luck <tony.luck@intel.com>
Sat, 19 Jul 2008 20:45:33 +0000 (23:45 +0300)
committerAdrian Bunk <bunk@kernel.org>
Sat, 19 Jul 2008 20:45:33 +0000 (23:45 +0300)
commit1cd89cf10141ba63da2696db80727e753331d0ab
tree1f6ebcde191b43a241eeface2ab0b8dab2cac724
parent2f586e5589ef42afa60778aaab6641c99f9bc16a
[IA64] Fix unaligned handler for floating point instructions with base update

The compiler team did the hard work for this distilling a problem in
large fortran application which showed up when applied to a 290MB input
data set down to this instruction:

        ldfd f34=[r17],-8

Which they noticed incremented r17 by 0x10 rather than decrementing it
by 8 when the value in r17 caused an unaligned data fault.  I tracked
it down to some bad instruction decoding in unaligned.c. The code
assumes that the 'x' bit can determine whether the instruction is
an "ldf" or "ldfp" ... which it is for opcode=6 (see table 4-29 on
page 3:302 of the SDM).  But for opcode=7 the 'x' bit is irrelevent,
all variants are "ldf" instructions (see table 4-36 on page 3:306).

Note also that interpreting the instruction as "ldfp" means that the
"paired" floating point register (f35 in the example here) will also
be corrupted.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
arch/ia64/kernel/unaligned.c