powerpc/powernv: copy/paste - Mask SO bit in CR
authorHaren Myneni <haren@us.ibm.com>
Mon, 4 Jun 2018 08:33:38 +0000 (18:33 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 4 Jun 2018 12:58:41 +0000 (22:58 +1000)
NX can set the 3rd bit in CR register for XER[SO] (Summary overflow)
which is not related to paste request. The current paste function
returns failure for a successful request when this bit is set. So mask
this bit and check the proper return status.

Fixes: 2392c8c8c045 ("powerpc/powernv/vas: Define copy/paste interfaces")
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: Haren Myneni <haren@us.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/copy-paste.h

index 3fa62de96d9ca37faf23daf49c12d54f5c727754..cb36f9fbcef3e7a9f3f7031a303a2a00abe6ab0e 100644 (file)
@@ -41,5 +41,6 @@ static inline int vas_paste(void *paste_address, int offset)
                : "b" (offset), "b" (paste_address)
                : "memory", "cr0");
 
-       return (cr >> CR0_SHIFT) & CR0_MASK;
+       /* We mask with 0xE to ignore SO */
+       return (cr >> CR0_SHIFT) & 0xE;
 }