Re: [PATCH 2/3] s390/xor: Improve inline assembly constraints
From: Vasily Gorbik
Date: Mon Mar 02 2026 - 11:08:55 EST
On Mon, Mar 02, 2026 at 02:34:59PM +0100, Heiko Carstens wrote:
> 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@xxxxxxxxxxxxx>
> ---
> arch/s390/lib/xor.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Vasily Gorbik <gor@xxxxxxxxxxxxx>