Skip to content

Commit 158f196

Browse files
paulusmackmpe
authored andcommitted
powerpc: Fix check for copy/paste instructions in alignment handler
Commit 07d2a62 ("powerpc/64s: Avoid cpabort in context switch when possible", 2017-06-09) changed the definition of PPC_INST_COPY and in so doing inadvertently broke the check for copy/paste instructions in the alignment fault handler. The check currently matches no instructions. This fixes it by ANDing both sides of the comparison with the mask. Fixes: 07d2a62 ("powerpc/64s: Avoid cpabort in context switch when possible") Cc: stable@vger.kernel.org # v4.13+ Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de> Signed-off-by: Paul Mackerras <paulus@ozlabs.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent 0b167f1 commit 158f196

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/powerpc/kernel/align.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ int fix_alignment(struct pt_regs *regs)
332332
* when pasting to a co-processor. Furthermore, paste_last is the
333333
* synchronisation point for preceding copy/paste sequences.
334334
*/
335-
if ((instr & 0xfc0006fe) == PPC_INST_COPY)
335+
if ((instr & 0xfc0006fe) == (PPC_INST_COPY & 0xfc0006fe))
336336
return -EIO;
337337

338338
r = analyse_instr(&op, regs, instr);

0 commit comments

Comments
 (0)