linux/arch/parisc
Helge Deller df1d445e7f parisc: Fix exception handler for fldw and fstw instructions
commit 7ae1f5508d upstream.

The exception handler is broken for unaligned memory acceses with fldw
and fstw instructions, because it trashes or uses randomly some other
floating point register than the one specified in the instruction word
on loads and stores.

The instruction "fldw 0(addr),%fr22L" (and the other fldw/fstw
instructions) encode the target register (%fr22) in the rightmost 5 bits
of the instruction word. The 7th rightmost bit of the instruction word
defines if the left or right half of %fr22 should be used.

While processing unaligned address accesses, the FR3() define is used to
extract the offset into the local floating-point register set.  But the
calculation in FR3() was buggy, so that for example instead of %fr22,
register %fr12 [((22 * 2) & 0x1f) = 12] was used.

This bug has been since forever in the parisc kernel and I wonder why it
wasn't detected earlier. Interestingly I noticed this bug just because
the libime debian package failed to build on *native* hardware, while it
successfully built in qemu.

This patch corrects the bitshift and masking calculation in FR3().

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-31 17:15:13 +02:00
..
boot vmlinux.lds.h: Split ELF_DETAILS from STABS_DEBUG 2020-09-01 09:50:35 +02:00
configs parisc: disable CONFIG_IDE in defconfigs 2020-10-15 08:10:38 +02:00
include parisc/stifb: Fix fb_is_primary_device() only available with CONFIG_FB_STI 2022-06-29 08:59:53 +02:00
kernel parisc: Fix exception handler for fldw and fstw instructions 2022-08-31 17:15:13 +02:00
lib parisc: Add ioread64_lo_hi() and iowrite64_lo_hi() 2022-02-23 12:00:58 +01:00
math-emu parisc: math-emu: Fix fall-through warnings 2021-10-27 09:56:46 +02:00
mm parisc: Fix handling off probe non-access faults 2022-04-08 14:40:32 +02:00
oprofile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
defpalo.conf
install.sh parisc: Fix "make install" on newer debian releases 2021-12-08 09:03:28 +01:00
Kconfig parisc: Enable ARCH_HAS_STRICT_MODULE_RWX 2022-06-29 08:59:53 +02:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile parisc: Fix KBUILD_IMAGE for self-extracting kernel 2021-12-08 09:03:28 +01:00
nm