Skip to content

Commit

Permalink
parisc/unaligned: Fix ldw() and stw() unalignment handlers
Browse files Browse the repository at this point in the history
commit a972798 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
hdeller authored and gregkh committed Mar 2, 2022
1 parent 397b543 commit 646b532
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/parisc/kernel/unaligned.c
Expand Up @@ -340,7 +340,7 @@ static int emulate_stw(struct pt_regs *regs, int frreg, int flop)
: "r" (val), "r" (regs->ior), "r" (regs->isr)
: "r19", "r20", "r21", "r22", "r1", FIXUP_BRANCH_CLOBBER );

return 0;
return ret;
}
static int emulate_std(struct pt_regs *regs, int frreg, int flop)
{
Expand Down Expand Up @@ -619,10 +619,10 @@ void handle_unaligned(struct pt_regs *regs)
{
case OPCODE_FLDW_L:
flop=1;
ret = emulate_ldw(regs, R2(regs->iir),0);
ret = emulate_ldw(regs, R2(regs->iir), 1);
break;
case OPCODE_LDW_M:
ret = emulate_ldw(regs, R2(regs->iir),1);
ret = emulate_ldw(regs, R2(regs->iir), 0);
break;

case OPCODE_FSTW_L:
Expand Down

0 comments on commit 646b532

Please sign in to comment.