Thread (2 messages) flat view 2 messages, 2 authors, 2017-10-25

Re: [PATCH] powerpc: Fix check for copy/paste instructions in alignment handler

From: Nicholas Piggin <hidden>
Date: 2017-10-25 15:22:50

On Wed, 25 Oct 2017 18:16:53 +1100
Paul Mackerras [off-list ref] wrote:
Commit 07d2a628bc00 ("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.
Thanks for fixing it. Any reason not to change the mask to 0xfc2006fe
to include the 'last' bit that is now mandatory?

Thanks,
Nick
quoted hunk
Fixes: 07d2a628bc00 ("powerpc/64s: Avoid cpabort in context switch
when possible")
Reported-by: Markus Trippelsdorf <redacted>
Signed-off-by: Paul Mackerras <redacted>
---
Should go to 4.13 stable as well, and will probably apply there
with fuzz.

 arch/powerpc/kernel/align.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 43ef251..3e6c074 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -332,7 +332,7 @@ int fix_alignment(struct pt_regs *regs)
 	 * when pasting to a co-processor. Furthermore, paste_last is the
 	 * synchronisation point for preceding copy/paste sequences.
 	 */
-	if ((instr & 0xfc0006fe) == PPC_INST_COPY)
+	if ((instr & 0xfc0006fe) == (PPC_INST_COPY & 0xfc0006fe))
 		return -EIO;
 
 	r = analyse_instr(&op, regs, instr);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help