[PATCH v8 2/4] arm64: vdso: Implement __vdso_futex_robust_try_unlock()

Mark Rutland mark.rutland at arm.com
Thu Sep 17 03:45:43 PDT 2026


On Wed, Sep 16, 2026 at 10:06:25PM -0300, André Almeida wrote:
> If I understood correctly, the correct approach here would be to use pop_reg
> as an input operand, making sure that we store the address hold by *pop on
> x2 register right? So something along the lines:
> 
> __u32 __vdso_futex_robust_list64_try_unlock(__u32 *lock, __u32 tid, __u64
> *pop)
> {
> 	register __u64 pop_reg asm("x2") = (__u64) pop;
> 
> ...
> 
> 		"	str 	xzr, [%x[pop_reg]]		\n"
> ...
> 
> 		: [val] "=&r" (val),
> 		  [result] "=&r" (result_reg),
> 		  [lock] "+Q" (*lock)
> 		: [tid] "r" (tid),
> 		  [pop_reg] "r" (pop_reg)
> 		: "cc", "memory"
> 
> Does that looks right?

Yep; that should work!

Just for completeness: another option would be to drop the memory
clobber, and have separate constraints for the "pop" memory location and
the "pop_reg" register. I think your suggestion above is simpler, so
let's go with that.

Mark.



More information about the linux-arm-kernel mailing list