linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Haren Myneni <haren@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org,
	Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Subject: Re: [PATCH] powerpc: paste - Mask XERSO bit in CR
Date: Fri, 27 Apr 2018 00:46:17 -0700	[thread overview]
Message-ID: <5AE2D549.9010105@linux.vnet.ibm.com> (raw)
In-Reply-To: <871sf15fl4.fsf@concordia.ellerman.id.au>

On 04/26/2018 11:27 PM, Michael Ellerman wrote:
> Haren Myneni <haren@linux.vnet.ibm.com> writes:
>>     
>> NX can set 3rd bit in CR register for XER[SO] (Summation overflow)
>> which is not used for paste return value. So. mask this bit to get
>> proper return status.
> 
> This sounds like a bug fix, but I can't tell from the change log.
> 
> What happens if we don't merge this patch? Is it bad?
> 
> Should I add:
> 
>   Fixes: 2392c8c8c045 ("powerpc/powernv/vas: Define copy/paste interfaces")
>   Cc: stable@vger.kernel.org # v4.14+

Thanks for your review. 

Yes, it is a bug, We should ignore XER[SO] from the return status which is nothing to with NX. Otherwise, successful paste instruction will be returned as failure when this bit is set. Not easy to reproduce. We did not see this bug on P9 NX 842 so far, but noticed this issue few times when testing user space NX gzip with 32 threads and 1 million requests per thread. We added similar fix on P8 (with icswx) and can happen on P9 NX842. 

P8 fix - 6333ed8f26cf crypto: nx-842 - Mask XERS0 bit in return value

paste (powerISA V3.0b page#855): 

CR0 Description
0b000||XERSO Data transfer failed due to a
sequence error or a conflict with
tlbie or some implementation-
specific problem.
0b001||XERSO Data transfer successful

I will resend patch with more description.

Thanks
Haren

> 
> 
> cheers
> 
>> diff --git a/arch/powerpc/platforms/powernv/copy-paste.h b/arch/powerpc/platforms/powernv/copy-paste.h
>> index c9a5036..82392e3 100644
>> --- a/arch/powerpc/platforms/powernv/copy-paste.h
>> +++ b/arch/powerpc/platforms/powernv/copy-paste.h
>> @@ -9,7 +9,8 @@
>>  #include <asm/ppc-opcode.h>
>>  
>>  #define CR0_SHIFT	28
>> -#define CR0_MASK	0xF
>> +#define CR0_MASK	0xE /* 3rd bit undefined or set for XER[SO] */
>> +
>>  /*
>>   * Copy/paste instructions:
>>   *
> 

      reply	other threads:[~2018-04-27  7:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-26  6:48 [PATCH] powerpc: paste - Mask XERSO bit in CR Haren Myneni
2018-04-27  6:27 ` Michael Ellerman
2018-04-27  7:46   ` Haren Myneni [this message]

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=5AE2D549.9010105@linux.vnet.ibm.com \
    --to=haren@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=sukadev@linux.vnet.ibm.com \
    /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).