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.8 required=3.0 tests=BAYES_00, 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 C7E83C2D0A8 for ; Wed, 23 Sep 2020 18:46:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 150D3235FD for ; Wed, 23 Sep 2020 18:46:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 150D3235FD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 25C156B0003; Wed, 23 Sep 2020 14:46:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 20C106B005A; Wed, 23 Sep 2020 14:46:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0AD126B0037; Wed, 23 Sep 2020 14:46:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id DC7CC6B005A for ; Wed, 23 Sep 2020 14:46:12 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 97C252490 for ; Wed, 23 Sep 2020 18:46:12 +0000 (UTC) X-FDA: 77295206184.18.prose41_42021bc27158 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 3BB83100DD3CD; Wed, 23 Sep 2020 18:46:12 +0000 (UTC) X-HE-Tag: prose41_42021bc27158 X-Filterd-Recvd-Size: 5554 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) by imf47.hostedemail.com (Postfix) with ESMTP; Wed, 23 Sep 2020 18:46:11 +0000 (UTC) Received: from mail-qt1-f175.google.com ([209.85.160.175]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPSA (Nemesis) id 1M3mHT-1kKKQs2NJT-000vkq; Wed, 23 Sep 2020 20:46:09 +0200 Received: by mail-qt1-f175.google.com with SMTP id c18so801005qtw.5; Wed, 23 Sep 2020 11:46:08 -0700 (PDT) X-Gm-Message-State: AOAM530flGmYepUFz7YKNZRKSYGPsMJMDAus6RDgd3luKjfxj3gWaMH1 MLmdOfVNbQtrwDVM+O05wg+YH0IizfRjz2hTrYc= X-Google-Smtp-Source: ABdhPJwsvaOBWtaZA0D/OVEHB/gCWu247kr3QZZFrdP10NBc4wqx9Hcp+T5ZYDolhQMYUd20W7JjEkRUKsdbgp0ivyQ= X-Received: by 2002:ac8:64a:: with SMTP id e10mr1527617qth.142.1600886767946; Wed, 23 Sep 2020 11:46:07 -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: Arnd Bergmann Date: Wed, 23 Sep 2020 20:45:51 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 5/9] fs: remove various compat readv/writev helpers To: Al Viro Cc: Christoph Hellwig , Andrew Morton , Jens Axboe , David Howells , David Laight , Linux ARM , "linux-kernel@vger.kernel.org" , "open list:BROADCOM NVRAM DRIVER" , Parisc List , linuxppc-dev , linux-s390 , sparclinux , linux-block , linux-scsi , Linux FS-devel Mailing List , linux-aio , io-uring@vger.kernel.org, linux-arch , Linux-MM , Networking , keyrings@vger.kernel.org, LSM List Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:EFNboF17l3L0uCn1GZT6ThmsGE9Gp0x1dAE7WSSodZjOhn6s+Ug LfKP5zMsh9hpy9BWtnxfq+w3QZgo+HJol+jI4yjLcncJTbu5wmJTcfgxepfyzPJzF0DTWgX 41JJOPAbZWGZV36OazevPvHBrfY8x5IUnIDWQbWL2hxhV+lOe14c8SS0wK0CS0jWz84EYPK qOG7tiEfdhwm2/Im1veow== X-UI-Out-Filterresults: notjunk:1;V03:K0:mkco/ONsERs=:CtgLnM90jRLIGQYC5IVGe1 1WgMgtNPcC1SSZDqHqWQh7SlPqQFCnVWtFAXYwRMfUgT9PoH0CdmoL16K+AKDorv9ubBrq29B cNV0vyaTWPWFtaGyybAD8D9NG7mDJNrt2gRWuxrM1u8WJNFUgIsWXFJHWHJBOWSSDl5uqitBo Z/kdk/HzbR/I0vOipbm8os41DjT2+zR8FIr1t+2we41U+M0thmDmLxX+iUdCHLnQ0I6sCQGPs qST5sKYvIGDC+sYfsB6pwXDKEK5pBfPE5tfMZj1on+ts6THQ+kbXpUfjsIIWLjCDqMzRe20yB k33vNyyBQz8vUxqfJkqRIQVbTQt1fLs96mj7P67FuAbYtZc3KOeBZLGJ+ayI8HnQpN3F0YJ2/ wNx7TicslmXT8OoRRXw97msfSVHZ4Ffp7BIV+VEhxCXqpgNbD5fAXaGZabsAy/W52bo2ZInkN +pOjlebzeYf14jFPN1O4CBzZ//yzFUgB1aSklQq1GHHlPADiBrnBiiOQPR11ZLlVukYTagssz 5RTZ6/ojT/2LqYsE7QPkBdTK2RoMJooaiHdfH8HqlnvxPWx71++X1WmE3hWMh+D6k6miyIVc4 GSq7FKVaP+f4CYJVJOHOJuV8rBgUJbJiNHnWoTuZCutnuu2tu3F1Y4IE0SvBhHg18CGsUkMx2 OB91ta8ZSMUjoot0e5W9L0FI8m2aJ7VOWfW5Wm+4WXGRr+gjy60+FRt4X/mhjXw0bheD/5Qse nyhXSWSWMVpMfUiSezij+huJSMhiat2fF8CoPrnz5dMDvI3pjP8pyOEzokm34xDbrXCaxjF90 txDHMDv7OSGEoM2TrEvLGYYV5PDNm9Wd80ZMky+wmPDI58IoHjgPNbyYuFwILRSxdZNaknv 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 6:38 PM Al Viro wrote: > > 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've had some ideas along those lines in the past and I think it should work. As a variation of this, the SYSCALL_DEFINEx() macros could go away entirely, leaving only the macro instantiations from the header to require that syntax. It would require first changing the remaining architectures to build the syscall table from C code instead of assembler though. Regardless of that, another advantage of having the SYSCALL_DECLAREx() would be the ability to include that header file from elsewhere with a different macro definition to create a machine-readable version of the interface when combined with the syscall.tbl files. This could be used to create a user space stub for calling into the low-level syscall regardless of the libc interfaces, or for synchronizing the interfaces with strace, qemu-user, or anything that needs to deal with the low-level interface. Arnd