]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
s390/xor: Improve inline assembly constraints
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 2 Mar 2026 13:34:59 +0000 (14:34 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 3 Mar 2026 15:42:14 +0000 (16:42 +0100)
commit87ff6da3001b2a35d241c5d965b82536f6418277
tree4d64aa201c8d03ae80f7f14b7bca9913036b68a1
parentf775276edc0c505dc0f782773796c189f31a1123
s390/xor: Improve inline assembly constraints

The inline assembly constraint for the "bytes" operand is "d" for all xor()
inline assemblies. "d" means that any register from 0 to 15 can be used. If
the compiler would use register 0 then the exrl instruction would not or
the value of "bytes" into the executed instruction - resulting in an
incorrect result.

However all the xor() inline assemblies make hard-coded use of register 0,
and it is correctly listed in the clobber list, so that this cannot happen.

Given that this is quite subtle use the better "a" constraint, which
excludes register 0 from register allocation in any case.

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-3-hca@linux.ibm.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/lib/xor.c