Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp570317pxk; Wed, 23 Sep 2020 10:10:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJww9NdIYQkJ7zrZXpSJJlss3DvDAnCeGxy0Pz79kNfXXy5P6a7j+YwCnIo20AnhYxxxWQXC X-Received: by 2002:a50:8881:: with SMTP id d1mr345062edd.306.1600881027021; Wed, 23 Sep 2020 10:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600881027; cv=none; d=google.com; s=arc-20160816; b=a8uL6Ba76FJS6EYLEP1XPr1ybJ+OS24q2Sk7faFxOquHIfVukPzLAi8oEvsl9ojj0/ BKCBvkPbdEsGZez67/xXOOE/3p+XHkn86EhC1DDjmjVyStohbKSisYj7D6JTanun1Pa1 WlXHO3Y/4Cuv9cCadNN235HGRHZrD+fX2C0ZBGRLw4VMdCE/rptJwhVV1mS044xr/qLC KwNY8MivdpbUdnTKV2KMMAbKny42vy5gXTGWkCVvxed3aYUVFFyAUlh6ZTav1fPmAJS5 /dMVVmIt+8MM3d7+RaWf19ruqfONs4gsgDQ1SOtqIPrVwBEx/2YeZdDqUTK1Y0XAc4CL UHUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ytIfUWOmJqLPL+KzEZROrbe3lD4J5ZzRU4bHZaNkG6o=; b=AP64hUK4weRNsGwoz5Hhjl85F3tN4Ov9Rby/xbX3/FiLJD+OP2j/a6i9QhpPiYpwfm ArEJzucAt9SdQIBP/+MJshDs9aBKzKIQ4vZNFXLOrjiaBFk+RdYcqunK4+AC/zD/7GwJ FQZxzrIK9p3taL73ErIjfr9xV6MobJrZkvSDhEXeqig7xITNfDpSQojDVOIEfnS3U+d7 7e8levnNBsTZnLUaN2CWVbPCw4FRDa4dq+VenFiEVVfo6QXjiQuIrEMlp46wtXCHhehp yEqiMj5gDZKN/+BYr0xzWx0Kx21IrsKpordmNGDBQtLq2hwDZjsjbNnf3t+EbkWY9+eL F31w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SJdkZUQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si341709ejk.68.2020.09.23.10.10.02; Wed, 23 Sep 2020 10:10:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SJdkZUQ5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726774AbgIWRJC (ORCPT + 99 others); Wed, 23 Sep 2020 13:09:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgIWRJB (ORCPT ); Wed, 23 Sep 2020 13:09:01 -0400 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EE84C0613CE; Wed, 23 Sep 2020 10:09:01 -0700 (PDT) Received: by mail-il1-x141.google.com with SMTP id t12so346238ilh.3; 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=l/ejPnyC86aP/SIXBnObQ0REfhnvAMPlGBTgsjnoFbe8WZ/E9ar6LY5+XXFvAPGJ21 BuLa8kUA40Po3oMi6wWKfqXGeJn4ufi7/bLU0Bd2DmtlFDc9S5umwxQh0YkGQEpARN29 MX2uFX2kfGXqpncZgaW3XrgcZ2li5Wvr8K81BztGqG8rwGiR1sF9i8/w9phnCh8A0W6d zYUThtXKioC2Q1oQVF+Tlhfoy7NpqOvmSIgXZwh1VXl3igvc+XAq2Fxe2e7P++MSyYkW cf/JXlv6zuUj8SNz7YnwjOF1KVdvHcbPi8bzZO7USkKb3Se8s9IMzgl3FuKkAwK1F75+ SSMw== X-Gm-Message-State: AOAM530RUah7vGM7wPg7ndnrod5ofQsKXQloTK+Nj9PBklvMLec+ZkKP Fb6DANmx9gHkRARKufBcE0scHKcQN5ihOFVkDA== 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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