]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/xor: Fix xor_xc_2() inline assembly constraints
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 2 Mar 2026 13:34:58 +0000 (14:34 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 3 Mar 2026 15:42:14 +0000 (16:42 +0100)
The inline assembly constraints for xor_xc_2() are incorrect. "bytes",
"p1", and "p2" are input operands, while all three of them are modified
within the inline assembly. Given that the function consists only of this
inline assembly it seems unlikely that this may cause any problems, however
fix this in any case.

Fixes: 2cfc5f9ce7f5 ("s390/xor: optimized xor routing using the XC instruction")
Cc: stable@vger.kernel.org
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Link: https://lore.kernel.org/r/20260302133500.1560531-2-hca@linux.ibm.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/lib/xor.c

index a4d8b51beb95f74da7fe4a88970282a6e2b23816..81c0235c04666ef98567036f8ddbf9047333833a 100644 (file)
@@ -28,8 +28,8 @@ static void xor_xc_2(unsigned long bytes, unsigned long * __restrict p1,
                "       j       3f\n"
                "2:     xc      0(1,%1),0(%2)\n"
                "3:"
-               : : "d" (bytes), "a" (p1), "a" (p2)
-               : "0", "cc", "memory");
+               : "+d" (bytes), "+a" (p1), "+a" (p2)
+               : "0", "cc", "memory");
 }
 
 static void xor_xc_3(unsigned long bytes, unsigned long * __restrict p1,