Re: [patch 8/8] x86/vdso: Implement __vdso_futex_robust_try_unlock()
From: Thomas Gleixner
Date: Mon Mar 16 2026 - 17:29:59 EST
On Mon, Mar 16 2026 at 15:19, Mathieu Desnoyers wrote:
> On 2026-03-16 13:13, Thomas Gleixner wrote:
>> +{
>> + asm volatile (
>> + ".global __vdso_futex_robust_try_unlock_cs_start \n"
>> + ".global __vdso_futex_robust_try_unlock_cs_success \n"
>> + ".global __vdso_futex_robust_try_unlock_cs_end \n"
>
> Those .global are fragile: they depend on making sure the compiler does
> not emit those symbols more than once per compile unit (due to
> optimizations).
This is a single global function which contains the unique ASM code with
those unique symbols. The unique compilation unit containing it ends up
in the VDSO "library".
Q: Which optimizations would cause the compiler to emit them more than
once?
A: None.
If that happens then the compiler is seriously broken and the resulting
VDSO trainwreck is the least of your worries.
That would be equivalent to a single global C function in a unique
compilation unit being emitted more than once.
So what is fragile about that?
Thanks,
tglx