Skip to content

Commit a972798

Browse files
committed
parisc/unaligned: Fix ldw() and stw() unalignment handlers
Fix 3 bugs: a) emulate_stw() doesn't return the error code value, so faulting instructions are not reported and aborted. b) Tell emulate_ldw() to handle fldw_l as floating point instruction c) Tell emulate_ldw() to handle ldw_m as integer instruction Signed-off-by: Helge Deller <deller@gmx.de> Cc: stable@vger.kernel.org
1 parent dd2288f commit a972798

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

arch/parisc/kernel/unaligned.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ static int emulate_stw(struct pt_regs *regs, int frreg, int flop)
340340
: "r" (val), "r" (regs->ior), "r" (regs->isr)
341341
: "r19", "r20", "r21", "r22", "r1", FIXUP_BRANCH_CLOBBER );
342342

343-
return 0;
343+
return ret;
344344
}
345345
static int emulate_std(struct pt_regs *regs, int frreg, int flop)
346346
{
@@ -619,10 +619,10 @@ void handle_unaligned(struct pt_regs *regs)
619619
{
620620
case OPCODE_FLDW_L:
621621
flop=1;
622-
ret = emulate_ldw(regs, R2(regs->iir),0);
622+
ret = emulate_ldw(regs, R2(regs->iir), 1);
623623
break;
624624
case OPCODE_LDW_M:
625-
ret = emulate_ldw(regs, R2(regs->iir),1);
625+
ret = emulate_ldw(regs, R2(regs->iir), 0);
626626
break;
627627

628628
case OPCODE_FSTW_L:

0 commit comments

Comments
 (0)