From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53739C433E1 for ; Tue, 21 Jul 2020 07:07:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38DB221702 for ; Tue, 21 Jul 2020 07:07:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726947AbgGUHHN (ORCPT ); Tue, 21 Jul 2020 03:07:13 -0400 Received: from verein.lst.de ([213.95.11.211]:50851 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726474AbgGUHHM (ORCPT ); Tue, 21 Jul 2020 03:07:12 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 8BF9468AFE; Tue, 21 Jul 2020 09:07:09 +0200 (CEST) Date: Tue, 21 Jul 2020 09:07:09 +0200 From: Christoph Hellwig To: Andy Lutomirski Cc: Jens Axboe , Christoph Hellwig , linux-arch@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org Subject: Re: io_uring vs in_compat_syscall() Message-ID: <20200721070709.GB11432@lst.de> References: <8987E376-6B13-4798-BDBA-616A457447CF@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8987E376-6B13-4798-BDBA-616A457447CF@amacapital.net> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Mon, Jul 20, 2020 at 10:28:55AM -0700, Andy Lutomirski wrote: > > Sure, I'd consider that implementation detail for the actual patch(es) > > for this issue. > > There’s a corner case, though: doesn’t io_uring submission frequently do the work synchronously in the context of the calling thread? Yes. > If so, can a thread do a 64-bit submit with 32-bit work or vice versa? In theory you could share an fd created in a 32-bit thread to a 64-bit thread or vice versa, but I think at that point you absolutely are in "you get to keep the pieces" land. > Sometimes I think that in_compat_syscall() should have a mode in which calling it warns (e.g. not actually in a syscall when doing things in io_uring). And the relevant operations should be properly wired up to avoid global state like this. What do you mean with "properly wired up". Do you really want to spread ->compat_foo methods everywhere, including read and write? I found in_compat_syscall() a lot small and easier to maintain than all the separate compat cruft.