Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3023600imm; Mon, 24 Sep 2018 14:17:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV60f0GLaIT0Ww1hLQr1B53ZANcrF4Z/eDSuc9vbE1JevwBQc2cpigpTv6EGaaQ1ErQRDmIG3 X-Received: by 2002:a62:4898:: with SMTP id q24-v6mr577717pfi.22.1537823874273; Mon, 24 Sep 2018 14:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537823874; cv=none; d=google.com; s=arc-20160816; b=XUrQsBz97bZuY6wjsPKkfZuU5AlpmFMsOSDgt2GN+W9GiUXtjCmYi0ZLJka31OIndG hwMbNxSIx2PZsMstg+P7hmgz6BwMaDURQavGhFwX2DxwviSmSBBp8W2FH7n6NU1gGGAa cxSOYKC3JstM0oZCZ0SfnkH8Ho6bRZ2hZYEZgbi3DT02t3mRUvn4L7Pu9RGRvnk55Jlt 5ZwSMcXdgHHoJAFGvXESXSUFsGSePM+AKMAV9Wuopw3juRo3VyOyN045h/pM/2jYcawx xVJuEgRGjs1BFMJyudzVhB6ZmFn6O3un/hupJlNZiR2qg86rLGQbrCrcghDRQi//5J35 uLnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=R2zzxBgg/8NvVC9r2LVRNtyuv4apxgAqKmjDoDkBQsY=; b=pb6WKYAPo4OPHxj3d5/EfNVhcm6AGvRwOFQyQqxTMgK1iOkLYLHOTiLO2/HUCFl2GX SvigHNZOykCu2lfEFTGpG0Z0f6RNXzzM7vX95mv70bKqBrlOc7OqIVnueg5SOtygTx0D TJobxbCODotz6BG4c2LFCeutVrJQohBxFCICqrd/09sdordoAIc2FoL8bpmBMXJxYv9E +D+4dRPgUzxmj/CWUwIFNSMTSu+G+b5UxcNUgDmE7KsDdr71NqrKIWGxHeNxAmI4Kg1o oeuIk7agQNaN+GfaSFCvimaEyB1LXEP2Wmku6PYTj7a3ScwfLgT6aK9HPl5hb7ctAtOy KSDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g20-v6si390162pgb.239.2018.09.24.14.17.39; Mon, 24 Sep 2018 14:17:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728560AbeIYDV2 (ORCPT + 99 others); Mon, 24 Sep 2018 23:21:28 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:43232 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728463AbeIYDV2 (ORCPT ); Mon, 24 Sep 2018 23:21:28 -0400 Received: by mail-qt1-f196.google.com with SMTP id l16-v6so10634574qtq.10; Mon, 24 Sep 2018 14:17:17 -0700 (PDT) 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=R2zzxBgg/8NvVC9r2LVRNtyuv4apxgAqKmjDoDkBQsY=; b=m3oub87+2L5CaG6KqUGUFCNFQAh+IrATvLMlnDkH5vH3Cq3ScmDIWXq/nCE970LGWH PSozLPvte5ls1QAfav8sFFjdOkRHD8ETgMrOxXm9lxM8TCX2Cpy2N4PIEyU5dEFVUl7Z 5MQ6uK9dmLueOOIRL6FgijpzVWANeUpJe0nRoZysKC5Q/jm4hLDXzxCV8s9bFtfCymkc wtzz8LkVOTUkRBAA+c0b1N+QO4xGgUIq32hFTndEJCjEMqU+Pmo2Ue0VdLi6gDjIGf5U o+fkdsGnOw6GQGj/fZiFzYzOGS7rVs3a3SJP9OXr+3QtTux8JbMBlNv7m/qzj3qcfoXa +fLw== X-Gm-Message-State: ABuFfognNM3UYjrlcnxl0oD2qAXRuTecXojnyT2GEkkkR1Zw9An6Z+Db WJOgaKTl4FB6msszpMtnfQm9eFHHDwFX59WcSL4= X-Received: by 2002:aed:3f08:: with SMTP id p8-v6mr545436qtf.185.1537823837231; Mon, 24 Sep 2018 14:17:17 -0700 (PDT) MIME-Version: 1.0 References: <20180912150142.157913-1-arnd@arndb.de> <20180912151134.436719-1-arnd@arndb.de> <20180914203506.GE35251@wrath> <20180914205748.GC19965@ZenIV.linux.org.uk> <20180918175108.GF35251@wrath> <20180918175952.GJ11367@ziepe.ca> <20180924203505.GC6008@ziepe.ca> In-Reply-To: <20180924203505.GC6008@ziepe.ca> From: Arnd Bergmann Date: Mon, 24 Sep 2018 23:17:01 +0200 Message-ID: Subject: Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg To: Jason Gunthorpe Cc: Darren Hart , Al Viro , Linux FS-devel Mailing List , gregkh , David Miller , driverdevel , Linux Kernel Mailing List , qat-linux@intel.com, "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Linux Media Mailing List , dri-devel , linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, "open list:HID CORE LAYER" , linux-iio@vger.kernel.org, linux-rdma , linux-nvdimm@lists.01.org, linux-nvme@lists.infradead.org, linux-pci , Platform Driver , linux-remoteproc@vger.kernel.org, sparclinux , linux-scsi , USB list , linux-fbdev@vger.kernel.org, linuxppc-dev , linux-btrfs , ceph-devel , linux-wireless , Networking Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 24, 2018 at 10:35 PM Jason Gunthorpe wrote: > On Mon, Sep 24, 2018 at 10:18:52PM +0200, Arnd Bergmann wrote: > > On Tue, Sep 18, 2018 at 7:59 PM Jason Gunthorpe wrote: > > > On Tue, Sep 18, 2018 at 10:51:08AM -0700, Darren Hart wrote: > > > > On Fri, Sep 14, 2018 at 09:57:48PM +0100, Al Viro wrote: > > > > > On Fri, Sep 14, 2018 at 01:35:06PM -0700, Darren Hart wrote: > > We already do this inside of some subsystems, notably drivers/media/, > > and it simplifies the implementation of the ioctl handler function > > significantly. We obviously cannot do this in general, both because of > > traditional drivers that have 16-bit command codes (drivers/tty and others) > > and also because of drivers that by accident defined the commands > > incorrectly and use the wrong type or the wrong direction in the > > definition. > > That could work well, but the first idea could be done globally and > mechanically, while this would require very careful per-driver > investigation. > > Particularly if the core code has worse performance.. ie due to > kmalloc calls or something. > > I think it would make more sense to start by having the core do the > case to __user and then add another entry point to have the core do > the copy_from_user, and so on. Having six separate callback pointers to implement a single system call seems a bit excessive though. Arnd