lkml.org 
[lkml]   [2023]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 06/10] io_uring: add support for futex wake and wait
From
On 7/21/23 5:37?AM, Peter Zijlstra wrote:
> On Fri, Jul 21, 2023 at 01:30:31PM +0200, Peter Zijlstra wrote:
>
> Sorry, I was too quick..
>
> iof->uaddr = sqe->addr;
> iof->val = sqe->futex_val;
> iof->mask = sqe->futex_mask;
> flags = sqe->futex_flags;
>
> if (flags & ~FUTEX2_MASK)
> return -EINVAL;
>
> iof->flags = futex2_to_flags(flags);
> if (!futex_flags_valid(iof->flags))
> return -EINVAL;
>
> if (!futex_validate_input(iof->flags, iof->val) ||
> !futex_validate_input(iof->flags, iof->mask))
> return -EINVAL

Something like that should work, with some variable names fixed up. I
just went with 'addr' for the futex address, addr2 for the value, and
addr3 for the mask.

Rebased on top of your first 4 updated patches, and added a single patch
that moves FUTEX2_MASK, will run some testing to validate it's all still
sane.

--
Jens Axboe

\
 
 \ /
  Last update: 2023-07-21 16:44    [W:0.083 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site