Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp3693430rwp; Sat, 15 Jul 2023 07:38:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlGF7tC/JXNAGc/eKqWWeSXAQA6H7wC6NJ47nWMKWqiFFq5tMUt/hp6qBk9CS2dwgcAyadXw X-Received: by 2002:a05:6a20:5487:b0:12f:dce2:b381 with SMTP id i7-20020a056a20548700b0012fdce2b381mr11694279pzk.3.1689431907979; Sat, 15 Jul 2023 07:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689431907; cv=none; d=google.com; s=arc-20160816; b=dBs1CMGNEu3Jf6v855UBeMmjPU6J/8mwNkturcxJ+joZK4daK04xM1vUHDenaPOw3A xubcv2ZchJh0Qj8lL41A8AoYo45np8xZhMgrPFLGzo655A2ph9lrSx4ronXt80oN+rkA g0rNYVGOrkLpxpKLtHXpTrclF9eH0aQmw6MOEZv0dxLrcpT2fxUAQG4HI83kvkQBD2RE zKJTUevR8kQUPpbRn9UOfJbzAx9hImPFJJevhpmyftnzCXCFNZRRDD/qrMn1tn9BmrXD H2gAmecZWtAdihmKjTKvMMThZ0+uBjmaNl4fJzs3Xtl8vMFzx0yVhbcU+sqSberQNXO1 suLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=9FX8SV9VaQXcPyY+22DvDJg3CIR8jtQiCFfi0aEKoJE=; fh=+MC/8vw98c7nYjW0BDlLKNwI6XEkwAgS3Vz+Y1UXgiE=; b=siTDn2TGMg1LYbVfFs5u7ec4CPejloaDBAfGNk8FDqdtKtQ4S5tET50KmOZBqLPtEf 1RL+qcFwSg1mh3kZI4KitsognPs/AGNTBVXXJ8b69X8gEHyKvUEOAsmMjS6PXemds+Pg fC/orRN6vT6zZrnIAlU3KLuh+WlbnqFiviF+ZRNUN2RDjC8/fbyBVa/QwfmBu/IhFCuh JI1i9SZu3lBjFqxkxuZxgr9qH2Xa/pHADz/OP+Wz/F1zHTiboxiQDl6Ca1dwVsKTrYtb CrihCjBE5gZUUaLjJozu9+Z83ME2Xc/wTP9b7xxG9snSzOyjZvMJSukcYiXHvZ+NLf75 M71g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=heJMETG6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12-20020a631e4c000000b00553c6af75d5si8638668pgm.315.2023.07.15.07.38.14; Sat, 15 Jul 2023 07:38:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20221208.gappssmtp.com header.s=20221208 header.b=heJMETG6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229854AbjGOOfG (ORCPT + 99 others); Sat, 15 Jul 2023 10:35:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbjGOOfF (ORCPT ); Sat, 15 Jul 2023 10:35:05 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FD4D2D51 for ; Sat, 15 Jul 2023 07:34:58 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-55b5a37acb6so378502a12.0 for ; Sat, 15 Jul 2023 07:34:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20221208.gappssmtp.com; s=20221208; t=1689431697; x=1690036497; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9FX8SV9VaQXcPyY+22DvDJg3CIR8jtQiCFfi0aEKoJE=; b=heJMETG6CVuiszjwnd0/PWq2IK7DVvt6kek88pc1PXNv7DwAdTcS6ChJk2wfee/qOV lDcspMtfFFXFsNLofIZt1K9j0GRH0h+26JsBrbNde3zHKiz5w2Vv3e5rouVOOAMVqCJ1 du9s90MkKIDwbhxWC+QMIiJoNWgEpQyVk1DVDttNJu8AQFJ5m0nPtGuEGx/9LYMq91/T BHegd5wiVHEEhAa0ntY5dmIygvDgCtrFFdQ6CRH+x+qBCI2DhZU1BHpkgc+VgMBptrm8 EVHE1xUz97SQ6fPBQokLRwam465dHiHPFaxqRpcdRlJ9IabHnf8ixYKOfEuqEgKz/bVq wrCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689431697; x=1690036497; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9FX8SV9VaQXcPyY+22DvDJg3CIR8jtQiCFfi0aEKoJE=; b=Y8l0oacsFmwMl6vtGzdAqmsaPerx1u0yFdf1vodiY22vwD2U/rEyBLNQfpCyrVzC5U LyUCsKJ94FWs3KCI+wNvBxa+DATey6JTEgePiunL14GAEdIc4ND67Q2xBYmhf5liCOre pZjR915xolUF4QnfpFzPKgqrK30ilYHn5pvSz8mkzbC0iDnQyQVxrwYFoFcU4K35pPV4 v6GoOwvh41IjmJzS36zav6J/xcm0gZwuCe93igBbyZaoc2tpIvC8uTL5HIeZXog5nJxG BlLMzGlXUUwS7R3FMd9xxnsmMSpnc0pAn21BGbkb8gqPOiuK8TBR49TptETF4QQH2Wv3 nZ8A== X-Gm-Message-State: ABy/qLY+yGfQJqIAUgR++wr2MjyqwASKWQEcMMP6aQtM2ETHVtcnfnGR avDWzL7aWFRhfubdjbYgJiqA9A== X-Received: by 2002:a17:903:32cf:b0:1b8:a469:53d8 with SMTP id i15-20020a17090332cf00b001b8a46953d8mr9947451plr.0.1689431697572; Sat, 15 Jul 2023 07:34:57 -0700 (PDT) Received: from ?IPV6:2620:10d:c085:21c1::1028? ([2620:10d:c090:400::5:5cbd]) by smtp.gmail.com with ESMTPSA id h5-20020a170902748500b001a95f632340sm9560570pll.46.2023.07.15.07.34.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Jul 2023 07:34:56 -0700 (PDT) Message-ID: <93218e35-62a5-f081-3598-c06f60bd16d5@kernel.dk> Date: Sat, 15 Jul 2023 08:34:55 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 5/5] io_uring: add IORING_OP_WAITID support Content-Language: en-US From: Jens Axboe To: Arnd Bergmann , Christian Brauner Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230711204352.214086-1-axboe@kernel.dk> <20230711204352.214086-6-axboe@kernel.dk> <8431d207-5e52-4f8c-a12d-276836174bad@app.fastmail.com> <048cfbce-5238-2580-2d53-2ca740e72d79@kernel.dk> <20230714-grummeln-sitzgelegenheit-1157c2feac71@brauner> <57926544-3936-410f-ae0e-6eff266ea59c@app.fastmail.com> <509f35fc-72dc-8676-4e3a-6bbc8d7eefb4@kernel.dk> In-Reply-To: <509f35fc-72dc-8676-4e3a-6bbc8d7eefb4@kernel.dk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/15/23 8:06?AM, Jens Axboe wrote: > On 7/15/23 1:12?AM, Arnd Bergmann wrote: >> On Fri, Jul 14, 2023, at 22:14, Jens Axboe wrote: >>> On 7/14/23 12:33?PM, Arnd Bergmann wrote: >>>> On Fri, Jul 14, 2023, at 17:47, Christian Brauner wrote: >>>>> On Tue, Jul 11, 2023 at 04:18:13PM -0600, Jens Axboe wrote: >>>>>>>> Does this require argument conversion for compat tasks? >>>>>>>> >>>>>>>> Even without the rusage argument, I think the siginfo >>>>>>>> remains incompatible with 32-bit tasks, unfortunately. >>>>>>> >>>>>>> Hmm yes good point, if compat_siginfo and siginfo are different, then it >>>>>>> does need handling for that. Would be a trivial addition, I'll make that >>>>>>> change. Thanks Arnd! >>>>>> >>>>>> Should be fixed in the current version: >>>>>> >>>>>> https://git.kernel.dk/cgit/linux/commit/?h=io_uring-waitid&id=08f3dc9b7cedbd20c0f215f25c9a7814c6c601cc >>>>> >>>>> In kernel/signal.c in pidfd_send_signal() we have >>>>> copy_siginfo_from_user_any() it seems that a similar version >>>>> copy_siginfo_to_user_any() might be something to consider. We do have >>>>> copy_siginfo_to_user32() and copy_siginfo_to_user(). But I may lack >>>>> context why this wouldn't work here. >>>> >>>> We could add a copy_siginfo_to_user_any(), but I think open-coding >>>> it is easier here, since the in_compat_syscall() check does not >>>> work inside of the io_uring kernel thread, it has to be >>>> "if (req->ctx->compat)" in order to match the wordsize of the task >>>> that started the request. >>> >>> Yeah, unifying this stuff did cross my mind when adding another one. >>> Which I think could still be done, you'd just need to pass in a 'compat' >>> parameter similar to how it's done for iovec importing. >>> >>> But if it's ok with everybody I'd rather do that as a cleanup post this. >> >> Sure, keeping that separate seem best. >> >> Looking at what copy_siginfo_from_user_any() actually does, I don't >> even think it's worth adapting copy_siginfo_to_user_any() for io_uring, >> since it's already just a trivial wrapper, and adding another >> argument would add more complexity overall than it saves. > > Yeah, took a look too this morning, and not sure there's much to reduce > here that would make it cleaner. I'm going to send out a v2 with this > unchanged, holler if people disagree. Looking over changes, none have been made so far. So I guess a v2 can wait a bit. The branch was rebased to add Christian's acked-bys for some of the patches, and since a branch it was based on (io_uring-futex) got rebased to accommodate PeterZ's changes. -- Jens Axboe