Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2789478ybt; Mon, 22 Jun 2020 07:07:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGdqoO/z0tOLaB1HdGkdo2JbO8xX0t4SfxdqmqMPeH7LoB51AZymZ1tsJIvZ0GkSv5Al2u X-Received: by 2002:a17:906:7212:: with SMTP id m18mr15828836ejk.29.1592834863760; Mon, 22 Jun 2020 07:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592834863; cv=none; d=google.com; s=arc-20160816; b=Tb7CmrG7dMlZttz47kWptmRdyUHu2GcC1G/yJyg6V4PMa8O/wJDuyjm55bMgU7irCj KwtIbly+9YCNjCcmZRBeLy5z/8uEVHim6seEY5fpdYwp4FZU0jFzF7Wgx2vhNOSC4LlH S+1N3wmGDgNl2Ng1+U5fCrnxUdA2XfYhSABT6Xt83VdGt/SzKrmyYbYRVqvNkKuJXoEb 6qOhFO3fJFMJNxixXJh/yOZVg5zjy8iad3mrJ7RUYwE3mgoJjLWletlxV9drt00amfEg vmpR36LjjUq2LADHoNg2Lmei/2cmKACmzzHCR7Vjy5ulHXAAA9AMA/ixY3YzCE2BSoLX gBMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to :reply-to:from:date; bh=sT/aVxZqgBb000WpPavRRVXyj1bTrZRjOLyzmp5NSPI=; b=0MvWdSGHyBqgEi3irLm1SlDCPNexxc0Hidbzjpp5T3U86DjNX6XVzrgYbebBX6Tz+q 1KpZ8Qs/Pb758mlXqmWOED4VYhQ/lgC9glZ/ie0rseRqDjqy4OwZsTlPySy6r4mD1+qx SGrLEUX/+jheBC6v+l3Zj8cdQ6bfug49NedjBoaPV+Y7OXzpdiIFASyyR6TSNlKOy0K0 wbmlg5OKIld9Mlne3o6mQEo10XF7qVvlMuA5FAcoOgd+Gm5uuz2p4yx+MqLblod4miLs kOHA/JPH+7SER+JwoM69j9al5HRZRSrfIN1kkDKDtNgc6Qbzyg5k4gA4eEAUuh6K+9jm Rq5w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si2857679eja.703.2020.06.22.07.07.20; Mon, 22 Jun 2020 07:07:43 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729278AbgFVODs (ORCPT + 99 others); Mon, 22 Jun 2020 10:03:48 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:48833 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729056AbgFVODs (ORCPT ); Mon, 22 Jun 2020 10:03:48 -0400 Received: from oxbsgw03.schlund.de ([172.19.248.4]) by mrelayeu.kundenserver.de (mreue012 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MnWx3-1j6aAT0ClJ-00jd9a; Mon, 22 Jun 2020 16:03:40 +0200 Date: Mon, 22 Jun 2020 16:03:39 +0200 (CEST) From: Thomas Ruf Reply-To: Thomas Ruf To: Federico Vaga Cc: Vinod Koul , Dave Jiang , Dan Williams , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <1170180786.545332.1592834619871@mailbusiness.ionos.de> In-Reply-To: <20200622123019.z3i2tjcfliwkbzkx@cwe-513-vol689.cern.ch> References: <5614531.lOV4Wx5bFT@harkonnen> <20200621072457.GA2324254@vkoul-mobl> <20200621203634.y3tejmh6j4knf5iz@cwe-513-vol689.cern.ch> <20200622044733.GB2324254@vkoul-mobl> <419762761.402939.1592827272368@mailbusiness.ionos.de> <20200622123019.z3i2tjcfliwkbzkx@cwe-513-vol689.cern.ch> Subject: Re: DMA Engine: Transfer From Userspace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-Mailer: Open-Xchange Mailer v7.10.1-Rev31 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K1:31RXAG7PmVL1FE5xGz3AStAC9Xv0UuQ9JmV597Q0V535hVtCO15 qFcMAQVxLBdvcojAEY/HAcXk2/v1LffyGmRKwOcMjDPxv1TNQItERQW5xNZJNThgVGyZQWP yqZ2n6Ep96mK1hedTPxmHWHVTQ5Ve3KtM03PkhCW2h1sD2Bqx13NeKtTMYcY3EfQncCLzVV 0KxpIt0OGGtmlmBDcKKkw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:bI90LEGy+q8=:5xY2M9HbXHeSqe9cHrm3ZD uXuN4WQr/R09VjR8EpTnulAa1PhQ9WRfYGff67asf8X+x3EQzm5KLHqTeZuqtnumlgCju57fT Hhf6YMuQhzSlOe1xfNNopzZaBusM7lgHNeOk7vb0WjaOgpkq9oUq3dE3w2v0C9K4InZa6/WHj 6MtAysRQCKXAJTb1aVu4D3kGyRmjicJ+BWuaKOUlAWB2VglvRSSibv1JoxnraxxmtMW0xSu8G Q/OvaNiRDWbz0JkPN9LflgbM+xqkjOQXb4XUGFDrIFSlsgQT0AV5xdh9DxhucVAzxtL0mKCnF tAWep70U97swA1d43NazLwv2Xv7mwboDRH2xuhg68+nq6iiSKtmOX0kksY+JepJaHKqhwZN52 q+K3HolxE5uIrlc01jyWQqKQ731V4tWE7yE7BKt8NIy/QxGv5zhAfM/e2FewYOC4SJavB8VtM mGpnEKbH67SAtcJVEMpO45/9l0KWWkEXNWDXk652vTQvkC/7sZ6v5T1Q/yHOIjgE+XzrMqimq WSYLuP7oCy8PzNLk4yyAFPoyQY1MG8iYy2YIF3gR9IBcr37V2AIex5iChqsak4fQTj+se+twr p9P/BeobPtB/trAqd0LWmgMNtDqvM9yN1klSMz/ShsmzbNoEfsLTvVXjgsIFQcdpEDBw8R1rl yxB/2igy2/9NDZhNYOjw/PcydZBtVdz+WEEwyxXHstS5K7iiibzss65lRMTncLROEL3U17j4U 0Np3CGf/dGxIDxgAGhgR4ksT77NDB2zgrRNn5SLXEum+zkvUcafKR7fy1T8e7ZL/1NVeCGxA+ nZZiuSYIXtEt5358Xmu/kzIZ4fzi/BdfOdgRfSt9pZW7yl1+nI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 22 June 2020 at 14:30 Federico Vaga wrote: > > > On Mon, Jun 22, 2020 at 02:01:12PM +0200, Thomas Ruf wrote: > >> On 22 June 2020 at 06:47 Vinod Koul wrote: > >> > >> On 21-06-20, 22:36, Federico Vaga wrote: > >> > On Sun, Jun 21, 2020 at 12:54:57PM +0530, Vinod Koul wrote: > >> > > On 19-06-20, 16:31, Dave Jiang wrote: > >> > > > > >> > > > > >> > > > On 6/19/2020 3:47 PM, Federico Vaga wrote: > >> > > > > Hello, > >> > > > > > >> > > > > is there the possibility of using a DMA engine channel from userspace? > >> > > > > > >> > > > > Something like: > >> > > > > - configure DMA using ioctl() (or whatever configuration mechanism) > >> > > > > - read() or write() to trigger the transfer > >> > > > > > >> > > > > >> > > > I may have supposedly promised Vinod to look into possibly providing > >> > > > something like this in the future. But I have not gotten around to do that > >> > > > yet. Currently, no such support. > >> > > > >> > > And I do still have serious reservations about this topic :) Opening up > >> > > userspace access to DMA does not sound very great from security point of > >> > > view. > >> > > >> > I was thinking about a dedicated module, and not something that the DMA engine > >> > offers directly. You load the module only if you need it (like the test module) > >> > >> But loading that module would expose dma to userspace. > >> > > >> > > Federico, what use case do you have in mind? > >> > > >> > Userspace drivers > >> > >> more the reason not do do so, why cant a kernel driver be added for your > >> usage? > > > >by chance i have written a driver allowing dma from user space using a memcpy like interface ;-) > >now i am trying to get this code upstream but was hit by the fact that DMA_SG is gone since Aug 2017 :-( > > Not sure to get what you mean by "DMA_SG is gone". Can I have a reference? here the link to the mailinglist when DMA_SG was removed: https://www.spinics.net/lists/dmaengine/msg13778.html > >just let me introduce myself and the project: > >- coding in C since '91 > >- coding in C++ since '98 > >- a lot of stuff not relevant for this ;-) > >- working as a freelancer since Nov '19 > >- implemented a "dma-sg-proxy" driver for my client in Mar/Apr '20 to copy camera frames from uncached memory to cached memory using a second dma on a Zynq platform > >- last week we figured out that we can not upgrade from "Xilinx 2019.2" (kernel 4.19.x) to "2020.1" (kernel 5.4.x) because the DMA_SG interface is gone > >- subscribed to dmaengine on friday, saw the start of this discussion on saturday > >- talked to my client today if it is ok to try to revive DMA_SG and get our driver upstream to avoid such problems in future > > > >here the struct for the ioctl: > > > >typedef struct { > > unsigned int struct_size; > > const void *src_user_ptr; > > void *dst_user_ptr; > > unsigned long length; > > unsigned int timeout_in_ms; > >} dma_sg_proxy_arg_t; > > Yes, roughly this is what I was thinking about cool, i really hope i get my stuff upstream! Best regards, Thomas