Skip to contentSkip to conversation

FAILED: patch "[PATCH] powerpc: Fix check for copy/paste instructions in alignment" failed to apply to 4.13-stable tree

PATCH [email protected] 1 participant 1 message Nov 5, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.13-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From 158f19698b594eb8a1bdf7d7937617abfaa4c4d9 Mon Sep 17 00:00:00 2001

From: Paul Mackerras <[email protected]>
Date: Wed, 25 Oct 2017 18:16:53 +1100
Subject: [PATCH] powerpc: Fix check for copy/paste instructions in alignment
handler

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.

Fixes 07d2a628bc00 ("powerpc/64s: Avoid cpabort in context switch when possible")
Cc [email protected] # v4.13+
arch/powerpc/kernel/align.c +1 -1
index 43ef25156480..3e6c0744c174 100644
@@ -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);