[PATCH] powerpc: paste - Mask XERSO bit in CR

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3034d

3 messages, 2 authors, 2018-04-27 · open the first message on its own page

[PATCH] powerpc: paste - Mask XERSO bit in CR

From: Haren Myneni <hidden>
Date: 2018-04-26 06:48:51

    
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.
    
Signed-off-by: Haren Myneni <haren@us.ibm.com>
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:
  *

Re: [PATCH] powerpc: paste - Mask XERSO bit in CR

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2018-04-27 06:27:36

Haren Myneni [off-list ref] 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+


cheers
quoted hunk
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:
  *

Re: [PATCH] powerpc: paste - Mask XERSO bit in CR

From: Haren Myneni <hidden>
Date: 2018-04-27 07:46:33

On 04/26/2018 11:27 PM, Michael Ellerman wrote:
Haren Myneni [off-list ref] writes:
quoted
    
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
quoted
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:
  *
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help