From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2007F210EFAEA for ; Mon, 24 Sep 2018 14:17:18 -0700 (PDT) Received: by mail-qt1-f193.google.com with SMTP id h22-v6so3173060qtr.13 for ; Mon, 24 Sep 2018 14:17:18 -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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Jason Gunthorpe Cc: linux-fbdev@vger.kernel.org, linux-iio@vger.kernel.org, linux-pci , linux-remoteproc@vger.kernel.org, linux-nvme@lists.infradead.org, Platform Driver , sparclinux , driverdevel , linux-scsi , linux-nvdimm@lists.01.org, linux-rdma , qat-linux@intel.com, amd-gfx@lists.freedesktop.org, "open list:HID CORE LAYER" , Darren Hart , Linux Media Mailing List , linaro-mm-sig@lists.linaro.org, dri-devel , ceph-devel , gregkh , USB list , linux-wireless , Linux Kernel Mailing List , "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" , Networking , Linux FS-devel Mailing List , linuxppc-dev , David Miller , linux-btrfs , Al Viro List-ID: 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 _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org 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 List-ID: 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 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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 C01F7ECE568 for ; Mon, 24 Sep 2018 21:17:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7FC99208D9 for ; Mon, 24 Sep 2018 21:17:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FC99208D9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728586AbeIYDV3 (ORCPT ); Mon, 24 Sep 2018 23:21:29 -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-Google-Smtp-Source: ACcGV600+tboLwtxr6q8SyQHIWnW+YzCxl/7gTIqTN76ybjiM0uW8wcQwahSSBcAthjiW96c6jblRT0dWwUCS6IUl9k= 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-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg Date: Mon, 24 Sep 2018 23:17:01 +0200 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pci , linux-remoteproc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Platform Driver , sparclinux , driverdevel , linux-scsi , linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org, linux-rdma , qat-linux-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, "open list:HID CORE LAYER" , Darren Hart , Linux Media Mailing List , linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.org, dri-devel , ceph-devel , gregkh , USB list , linux-wireless , Linux Kernel Mailing List Return-path: In-Reply-To: <20180924203505.GC6008-uk2M96/98Pc@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" List-Id: linux-crypto.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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg Date: Mon, 24 Sep 2018 23:17:01 +0200 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180924203505.GC6008-uk2M96/98Pc@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" To: Jason Gunthorpe Cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pci , linux-remoteproc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Platform Driver , sparclinux , driverdevel , linux-scsi , linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org, linux-rdma , qat-linux-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, "open list:HID CORE LAYER" , Darren Hart , Linux Media Mailing List , linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.org, dri-devel , ceph-devel , gregkh , USB list , linux-wireless Linux Kernel Mailing List List-Id: linux-rdma@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 From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Subject: [v2,05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg From: Arnd Bergmann Message-Id: Date: Mon, 24 Sep 2018 23:17:01 +0200 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 List-ID: T24gTW9uLCBTZXAgMjQsIDIwMTggYXQgMTA6MzUgUE0gSmFzb24gR3VudGhvcnBlIDxqZ2dAemll cGUuY2E+IHdyb3RlOgo+IE9uIE1vbiwgU2VwIDI0LCAyMDE4IGF0IDEwOjE4OjUyUE0gKzAyMDAs IEFybmQgQmVyZ21hbm4gd3JvdGU6Cj4gPiBPbiBUdWUsIFNlcCAxOCwgMjAxOCBhdCA3OjU5IFBN IEphc29uIEd1bnRob3JwZSA8amdnQHppZXBlLmNhPiB3cm90ZToKPiA+ID4gT24gVHVlLCBTZXAg MTgsIDIwMTggYXQgMTA6NTE6MDhBTSAtMDcwMCwgRGFycmVuIEhhcnQgd3JvdGU6Cj4gPiA+ID4g T24gRnJpLCBTZXAgMTQsIDIwMTggYXQgMDk6NTc6NDhQTSArMDEwMCwgQWwgVmlybyB3cm90ZToK PiA+ID4gPiA+IE9uIEZyaSwgU2VwIDE0LCAyMDE4IGF0IDAxOjM1OjA2UE0gLTA3MDAsIERhcnJl biBIYXJ0IHdyb3RlOgo+ID4gV2UgYWxyZWFkeSBkbyB0aGlzIGluc2lkZSBvZiBzb21lIHN1YnN5 c3RlbXMsIG5vdGFibHkgZHJpdmVycy9tZWRpYS8sCj4gPiBhbmQgaXQgc2ltcGxpZmllcyB0aGUg aW1wbGVtZW50YXRpb24gb2YgdGhlIGlvY3RsIGhhbmRsZXIgZnVuY3Rpb24KPiA+IHNpZ25pZmlj YW50bHkuIFdlIG9idmlvdXNseSBjYW5ub3QgZG8gdGhpcyBpbiBnZW5lcmFsLCBib3RoIGJlY2F1 c2Ugb2YKPiA+IHRyYWRpdGlvbmFsIGRyaXZlcnMgdGhhdCBoYXZlIDE2LWJpdCBjb21tYW5kIGNv ZGVzIChkcml2ZXJzL3R0eSBhbmQgb3RoZXJzKQo+ID4gYW5kIGFsc28gYmVjYXVzZSBvZiBkcml2 ZXJzIHRoYXQgYnkgYWNjaWRlbnQgZGVmaW5lZCB0aGUgY29tbWFuZHMKPiA+IGluY29ycmVjdGx5 IGFuZCB1c2UgdGhlIHdyb25nIHR5cGUgb3IgdGhlIHdyb25nIGRpcmVjdGlvbiBpbiB0aGUKPiA+ IGRlZmluaXRpb24uCj4KPiBUaGF0IGNvdWxkIHdvcmsgd2VsbCwgYnV0IHRoZSBmaXJzdCBpZGVh IGNvdWxkIGJlIGRvbmUgZ2xvYmFsbHkgYW5kCj4gbWVjaGFuaWNhbGx5LCB3aGlsZSB0aGlzIHdv dWxkIHJlcXVpcmUgdmVyeSBjYXJlZnVsIHBlci1kcml2ZXIKPiBpbnZlc3RpZ2F0aW9uLgo+Cj4g UGFydGljdWxhcmx5IGlmIHRoZSBjb3JlIGNvZGUgaGFzIHdvcnNlIHBlcmZvcm1hbmNlLi4gaWUg ZHVlIHRvCj4ga21hbGxvYyBjYWxscyBvciBzb21ldGhpbmcuCj4KPiBJIHRoaW5rIGl0IHdvdWxk IG1ha2UgbW9yZSBzZW5zZSB0byBzdGFydCBieSBoYXZpbmcgdGhlIGNvcmUgZG8gdGhlCj4gY2Fz ZSB0byBfX3VzZXIgYW5kIHRoZW4gYWRkIGFub3RoZXIgZW50cnkgcG9pbnQgdG8gaGF2ZSB0aGUg Y29yZSBkbwo+IHRoZSBjb3B5X2Zyb21fdXNlciwgYW5kIHNvIG9uLgoKSGF2aW5nIHNpeCBzZXBh cmF0ZSBjYWxsYmFjayBwb2ludGVycyB0byBpbXBsZW1lbnQgYSBzaW5nbGUKc3lzdGVtIGNhbGwg c2VlbXMgYSBiaXQgZXhjZXNzaXZlIHRob3VnaC4KCiAgICAgICAgQXJuZAo= From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Mon, 24 Sep 2018 21:17:01 +0000 Subject: Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg Message-Id: List-Id: 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-uk2M96/98Pc@public.gmane.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jason Gunthorpe Cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-pci , linux-remoteproc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Platform Driver , sparclinux , driverdevel , linux-scsi , linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org, linux-rdma , qat-linux-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, "open list:HID CORE LAYER" , Darren Hart , Linux Media Mailing List , linaro-mm-sig-cunTk1MwBs8s++Sfvej+rw@public.gmane.org, dri-devel , ceph-devel , gregkh , USB list , linux-wireless 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