lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250502190838.GB24078@noisy.programming.kicks-ass.net>
Date: Fri, 2 May 2025 21:08:38 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: linux-kernel@...r.kernel.org,
	André Almeida <andrealmeid@...lia.com>,
	Darren Hart <dvhart@...radead.org>,
	Davidlohr Bueso <dave@...olabs.net>, Ingo Molnar <mingo@...hat.com>,
	Juri Lelli <juri.lelli@...hat.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Valentin Schneider <vschneid@...hat.com>,
	Waiman Long <longman@...hat.com>
Subject: Re: [PATCH v12 21/21] selftests/futex: Add futex_numa_mpol

On Wed, Apr 16, 2025 at 06:29:21PM +0200, Sebastian Andrzej Siewior wrote:
> diff --git a/tools/testing/selftests/futex/include/futex2test.h b/tools/testing/selftests/futex/include/futex2test.h
> index 9d305520e849b..b664e8f92bfd7 100644
> --- a/tools/testing/selftests/futex/include/futex2test.h
> +++ b/tools/testing/selftests/futex/include/futex2test.h
> @@ -8,6 +8,11 @@
>  
>  #define u64_to_ptr(x) ((void *)(uintptr_t)(x))
>  
> +struct futex32_numa {
> +	futex_t futex;
> +	futex_t numa;
> +};
> +
>  /**
>   * futex_waitv - Wait at multiple futexes, wake on any
>   * @waiters:    Array of waiters
> @@ -20,3 +25,32 @@ static inline int futex_waitv(volatile struct futex_waitv *waiters, unsigned lon
>  {
>  	return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);
>  }
> +
> +static inline int futex2_wait(volatile struct futex_waitv *waiters, unsigned long nr_waiters,
> +			      unsigned long flags, struct timespec *timo, clockid_t clockid)
> +{
> +	return syscall(__NR_futex_waitv, waiters, nr_waiters, flags, timo, clockid);

I'm confused, sure this should be __NR_futex_wait

> +}
> +
> +/*
> + * futex_wait2() - block on uaddr with optional timeout
> + * @val:	Expected value
> + * @flags:	FUTEX2 flags
> + * @timeout:	Relative timeout
> + * @clockid:	Clock id for the timeout
> + */
> +static inline int futex2_wait2(void *uaddr, long val, unsigned int flags,
> +			      struct timespec *timeout, clockid_t clockid)

And this should be futex2_wait().


> +{
> +	return syscall(__NR_futex_wait, uaddr, val, 1, flags, timeout, clockid);
> +}
> +
> +/*
> + * futex2_wake() - Wake a number of futexes
> + * @nr:		Number of threads to wake at most
> + * @flags:	FUTEX2 flags
> + */
> +static inline int futex2_wake(void *uaddr, int nr, unsigned int flags)
> +{
> +	return syscall(__NR_futex_wake, uaddr, 1, nr, flags);
> +}
> -- 
> 2.49.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ