public inbox for linux-parisc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix ldw() and stw() unalignment handlers
@ 2022-02-18 22:40 Helge Deller
  0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2022-02-18 22:40 UTC (permalink / raw)
  To: linux-parisc, James Bottomley, John David Anglin, Sven Schnelle

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

diff --git a/arch/parisc/kernel/unaligned.c b/arch/parisc/kernel/unaligned.c
index a238b7fe8908..02fd2ecf4b16 100644
--- a/arch/parisc/kernel/unaligned.c
+++ b/arch/parisc/kernel/unaligned.c
@@ -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)
 {
@@ -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:

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-18 22:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-18 22:40 [PATCH] Fix ldw() and stw() unalignment handlers Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox