parisc/unaligned: Fix emulate_ldw() breakage
authorHelge Deller <deller@gmx.de>
Sun, 26 Jun 2022 23:39:11 +0000 (01:39 +0200)
committerHelge Deller <deller@gmx.de>
Mon, 27 Jun 2022 19:30:11 +0000 (21:30 +0200)
The commit e8aa7b17fe41 broke the 32-bit load-word unalignment exception
handler because it calculated the wrong amount of bits by which the value
should be shifted. This patch fixes it.

Signed-off-by: Helge Deller <deller@gmx.de>
Fixes: e8aa7b17fe41 ("parisc/unaligned: Rewrite inline assembly of emulate_ldw()")
Cc: stable@vger.kernel.org # v5.18
arch/parisc/kernel/unaligned.c

index ed1e88a74dc422cf0069820055507c69d23cf88a..bac581b5ecfc5f85e3cb9a3c63efaa020690756b 100644 (file)
@@ -146,7 +146,7 @@ static int emulate_ldw(struct pt_regs *regs, int toreg, int flop)
 "      depw    %%r0,31,2,%4\n"
 "1:    ldw     0(%%sr1,%4),%0\n"
 "2:    ldw     4(%%sr1,%4),%3\n"
-"      subi    32,%4,%2\n"
+"      subi    32,%2,%2\n"
 "      mtctl   %2,11\n"
 "      vshd    %0,%3,%0\n"
 "3:    \n"