* [PATCH] powerpc: Fix check for copy/paste instructions in alignment handler
@ 2017-10-25 7:16 Paul Mackerras
2017-11-01 5:17 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Paul Mackerras @ 2017-10-25 7:16 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev; +Cc: Markus Trippelsdorf, Nick Piggin
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")
Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
---
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);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: powerpc: Fix check for copy/paste instructions in alignment handler
2017-10-25 7:16 [PATCH] powerpc: Fix check for copy/paste instructions in alignment handler Paul Mackerras
@ 2017-11-01 5:17 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2017-11-01 5:17 UTC (permalink / raw)
To: Paul Mackerras, linuxppc-dev; +Cc: Nick Piggin, Markus Trippelsdorf
On Wed, 2017-10-25 at 07:16:53 UTC, Paul Mackerras 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.
>
> Fixes: 07d2a628bc00 ("powerpc/64s: Avoid cpabort in context switch
> when possible")
> Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/158f19698b594eb8a1bdf7d7937617
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-11-01 5:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-25 7:16 [PATCH] powerpc: Fix check for copy/paste instructions in alignment handler Paul Mackerras
2017-11-01 5:17 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).