[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230731162548.GN29590@hirez.programming.kicks-ass.net>
Date: Mon, 31 Jul 2023 18:25:48 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: axboe@...nel.dk, linux-kernel@...r.kernel.org, mingo@...hat.com,
dvhart@...radead.org, dave@...olabs.net, andrealmeid@...lia.com,
Andrew Morton <akpm@...ux-foundation.org>, urezki@...il.com,
hch@...radead.org, lstoakes@...il.com,
Arnd Bergmann <arnd@...db.de>, linux-api@...r.kernel.org,
linux-mm@...ck.org, linux-arch@...r.kernel.org,
malteskarupke@....de
Subject: Re: [PATCH v1 02/14] futex: Extend the FUTEX2 flags
On Mon, Jul 31, 2023 at 06:11:27PM +0200, Thomas Gleixner wrote:
> On Fri, Jul 21 2023 at 12:22, Peter Zijlstra wrote:
> > +#define FUTEX2_8 0x00
> > +#define FUTEX2_16 0x01
> > #define FUTEX2_32 0x02
> > - /* 0x04 */
> > +#define FUTEX2_64 0x03
> > +#define FUTEX2_NUMA 0x04
> > /* 0x08 */
> > /* 0x10 */
> > /* 0x20 */
> > --- a/kernel/futex/syscalls.c
> > +++ b/kernel/futex/syscalls.c
> > @@ -183,7 +183,7 @@ SYSCALL_DEFINE6(futex, u32 __user *, uad
> > return do_futex(uaddr, op, val, tp, uaddr2, (unsigned long)utime, val3);
> > }
> >
> > -#define FUTEX2_MASK (FUTEX2_32 | FUTEX2_PRIVATE)
> > +#define FUTEX2_MASK (FUTEX2_64 | FUTEX2_PRIVATE)
> >
> > /**
> > * futex_parse_waitv - Parse a waitv array from userspace
> > @@ -207,7 +207,12 @@ static int futex_parse_waitv(struct fute
> > if ((aux.flags & ~FUTEX2_MASK) || aux.__reserved)
> > return -EINVAL;
>
> With the above aux.flags with FUTEX2_32 set will result in -EINVAL. I
> don't think that's intentional.
FUTEX2_8 0
FUTEX2_16 1
FUTEX2_32 2
FUTEX2_64 3
Therefore FUTEX2_64, when used as a mask, includes then all.
Arnd suggested adding FUTEX2_SIZE_MASK or something. And I initially had
something like that, but pulled it for not wanting to pullute the uabi.
Can easily add back.
Powered by blists - more mailing lists