linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@au1.ibm.com>
To: Paul Mackerras <paulus@ozlabs.org>
Cc: Michael Ellerman <michael@ellerman.id.au>,
	linuxppc-dev@ozlabs.org,
	Markus Trippelsdorf <markus@trippelsdorf.de>
Subject: Re: [PATCH] powerpc: Fix check for copy/paste instructions in alignment handler
Date: Thu, 26 Oct 2017 01:22:37 +1000	[thread overview]
Message-ID: <20171026012237.0320e540@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <OFF18C8ACF.135B0A8D-ON002581C4.002803F5@notes.na.collabserv.com>

On Wed, 25 Oct 2017 18:16:53 +1100
Paul Mackerras <paulus@ozlabs.org> 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

> 
> 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);

       reply	other threads:[~2017-10-25 15:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OFF18C8ACF.135B0A8D-ON002581C4.002803F5@notes.na.collabserv.com>
2017-10-25 15:22 ` Nicholas Piggin [this message]
2017-10-25 22:41   ` [PATCH] powerpc: Fix check for copy/paste instructions in alignment handler Paul Mackerras
     [not found]   ` <OFE75272CA.7B26179F-ON002581C4.007CAB23@notes.na.collabserv.com>
2017-10-26  5:19     ` Nicholas Piggin
2017-10-25  7:16 Paul Mackerras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171026012237.0320e540@roar.ozlabs.ibm.com \
    --to=npiggin@au1.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=markus@trippelsdorf.de \
    --cc=michael@ellerman.id.au \
    --cc=paulus@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).