Re: [patch v2 11/11] x86/vdso: Implement __vdso_futex_robust_try_unlock()

From: Thomas Gleixner

Date: Fri Mar 20 2026 - 08:49:05 EST


On Fri, Mar 20 2026 at 08:14, Uros Bizjak wrote:
> On Fri, Mar 20, 2026 at 12:25 AM Thomas Gleixner <tglx@xxxxxxxxxx> wrote:
>> + [zero] "S" (0UL) \
>
> [zero] represents an internal register, so the above constraint can be
> "r" (*). If it remains a hard register constraint (%rsi) for some
> reason then the above two comments should be updated to reflect the
> new constraint.

Right. That's a leftover from some earlier experiment where I needed the
'zero' register at a fixed place, but that's all gone.

> With the constraint changed to "r":
>
> Acked-by: Uros Bizjak <ubizjak@xxxxxxxxx> (for asm template)
>
> (*) "r" allows the compiler some more freedom. The compiler tracks the
> values in registers, so it can reuse zero from an unrelated register
> without moving it to the %rsi and without clobbering the source
> register. In non-trivial functions, there is a high chance that needed
> value is already available in some register.

I'm aware of that.

Thanks,

tglx