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=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 9E784C4741F for ; Wed, 23 Sep 2020 17:09:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0C3CB20C09 for ; Wed, 23 Sep 2020 17:09:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SJdkZUQ5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C3CB20C09 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3AE946B006C; Wed, 23 Sep 2020 13:09:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3526C6B005C; Wed, 23 Sep 2020 13:09:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 21BB66B0062; Wed, 23 Sep 2020 13:09:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0199.hostedemail.com [216.40.44.199]) by kanga.kvack.org (Postfix) with ESMTP id F32256B005A for ; Wed, 23 Sep 2020 13:09:02 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id AD8F0182217A5 for ; Wed, 23 Sep 2020 17:09:02 +0000 (UTC) X-FDA: 77294961324.04.goose95_5b12add27158 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 4C61E8000FE8; Wed, 23 Sep 2020 17:09:02 +0000 (UTC) X-HE-Tag: goose95_5b12add27158 X-Filterd-Recvd-Size: 6171 Received: from mail-il1-f194.google.com (mail-il1-f194.google.com [209.85.166.194]) by imf18.hostedemail.com (Postfix) with ESMTP; Wed, 23 Sep 2020 17:09:01 +0000 (UTC) Received: by mail-il1-f194.google.com with SMTP id t13so298570ile.9; Wed, 23 Sep 2020 10:09:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ytIfUWOmJqLPL+KzEZROrbe3lD4J5ZzRU4bHZaNkG6o=; b=SJdkZUQ5ybixC9OLlVL9ihYm0CGLZ1cfDuOlRdKBWI5QTOmULV2iGenUUbUD5nTor1 kqILyv2JLjuaan6UAW6DDaQNCIcU/yd6/FB4cjytVESzyvnF521+vXIlGuspDiz4mn1x 0pe9AHsIqqDfUYIywe8ABpEPxZ0PmyFGn5nW6irTMP9h7VkNxgroibbBOMNzUXMn7vKx rVhw9xS6DwUCuluTBETmo7u/kv8kt+9usmeZxWSMpFV/oDBu5nsCmM/Qw8xhLz8Y3lKG ByUShFY2nuSD519gJ//MM/eqO74kPkrESHRriPZ7jnkjAQUVo2q29u3OUNdwzjm6srT3 IBjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ytIfUWOmJqLPL+KzEZROrbe3lD4J5ZzRU4bHZaNkG6o=; b=D79TONjcejmeAZQJgNb5jk9lRlNMfurcBvzSMGh8OQLbX3PeJcR/HNJsR/DQJOf6Sk Gz4BpHIFSbh45PgcgHJ44AgsZ86DcxT9YnGscBS3U0dtZZOjHlmysdJOJjA7qfdp1Agg FPoHmmbzHtgTcYMEqWb6zBEzPMiQ2UXu6f2gigkfeTH7n3jdPoZWOzpPrSVDKjRc1ucn ZpT8GLkWUz+sYXAKB/+RPZlSygCYUhHWBIeVvvEt3Ek3338m0GwykDiAyqOZnj+9zw7Y /1iSzwghwHf9nH/QsH6QWroZxIl+QKM/EqU+VdsXsuGpp4etqOzysirorfQCYbtalwuP M8Ew== X-Gm-Message-State: AOAM531AjnO7ygB1Mb/1xrMXkDUC/BhxkUi7p/gyUpW4gmuX4oI91Ud1 nub7VIkhZOmKZdjmfZqilOkh4GofpumWKflnGw== X-Google-Smtp-Source: ABdhPJx9AHt865Jv+eAAUR1TTStZMpA1/c10T3SLrotTbGP81GAP4lHvM3CmBFRNspJd1OouW0Bqrb/e9Ox1UsZBcH4= X-Received: by 2002:a92:99cb:: with SMTP id t72mr675478ilk.172.1600880940723; Wed, 23 Sep 2020 10:09:00 -0700 (PDT) MIME-Version: 1.0 References: <20200923060547.16903-1-hch@lst.de> <20200923060547.16903-6-hch@lst.de> <20200923142549.GK3421308@ZenIV.linux.org.uk> <20200923143251.GA14062@lst.de> <20200923145901.GN3421308@ZenIV.linux.org.uk> <20200923163831.GO3421308@ZenIV.linux.org.uk> In-Reply-To: <20200923163831.GO3421308@ZenIV.linux.org.uk> From: Brian Gerst Date: Wed, 23 Sep 2020 13:08:49 -0400 Message-ID: Subject: Re: [PATCH 5/9] fs: remove various compat readv/writev helpers To: Al Viro Cc: Christoph Hellwig , Andrew Morton , Jens Axboe , Arnd Bergmann , David Howells , David Laight , Linux ARM , Linux Kernel Mailing List , "open list:BROADCOM NVRAM DRIVER" , Parisc List , linuxppc-dev , linux-s390 , sparclinux , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org, Linux FS-devel Mailing List , linux-aio@kvack.org, io-uring@vger.kernel.org, linux-arch , Linux-MM , netdev@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Sep 23, 2020 at 12:39 PM Al Viro wrote: > > On Wed, Sep 23, 2020 at 03:59:01PM +0100, Al Viro wrote: > > > > That's a very good question. But it does not just compile but actually > > > works. Probably because all the syscall wrappers mean that we don't > > > actually generate the normal names. I just tried this: > > > > > > --- a/include/linux/syscalls.h > > > +++ b/include/linux/syscalls.h > > > @@ -468,7 +468,7 @@ asmlinkage long sys_lseek(unsigned int fd, off_t offset, > > > asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count); > > > asmlinkage long sys_write(unsigned int fd, const char __user *buf, > > > size_t count); > > > -asmlinkage long sys_readv(unsigned long fd, > > > +asmlinkage long sys_readv(void *fd, > > > > > > for fun, and the compiler doesn't care either.. > > > > Try to build it for sparc or ppc... > > FWIW, declarations in syscalls.h used to serve 4 purposes: > 1) syscall table initializers needed symbols declared > 2) direct calls needed the same > 3) catching mismatches between the declarations and definitions > 4) centralized list of all syscalls > > (2) has been (thankfully) reduced for some time; in any case, ksys_... is > used for the remaining ones. > > (1) and (3) are served by syscalls.h in architectures other than x86, arm64 > and s390. On those 3 (1) is done otherwise (near the syscall table initializer) > and (3) is not done at all. > > I wonder if we should do something like > > SYSCALL_DECLARE3(readv, unsigned long, fd, const struct iovec __user *, vec, > unsigned long, vlen); > in syscalls.h instead, and not under that ifdef. > > Let it expand to declaration of sys_...() in generic case and, on x86, into > __do_sys_...() and __ia32_sys_...()/__x64_sys_...(), with types matching > what SYSCALL_DEFINE ends up using. > > Similar macro would cover compat_sys_...() declarations. That would > restore mismatch checking for x86 and friends. AFAICS, the cost wouldn't > be terribly high - cpp would have more to chew through in syscalls.h, > but it shouldn't be all that costly. Famous last words, of course... > > Does anybody see fundamental problems with that? I think this would be a good idea. I have been working on a patchset to clean up the conditional syscall handling (sys_ni.c), and conflicts with the prototypes in syscalls.h have been getting in the way. Having the prototypes use SYSCALL_DECLAREx(...) would solve that issue. -- Brian Gerst