Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2786418ybt; Mon, 22 Jun 2020 07:03:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmyfuqdGBAuB6Is2VYPv2npMJQ8TkHb/Qpv6K/o4YjLpYcBOuSZELR5Ak4TO/wg3wHFC2l X-Received: by 2002:a17:906:365a:: with SMTP id r26mr15646792ejb.466.1592834637675; Mon, 22 Jun 2020 07:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592834637; cv=none; d=google.com; s=arc-20160816; b=FhYYiEWDrQvisQ6L6DxmSkvL8M+aDbH/DTzVHZB2eec6sHxhEVb7hwYPEPaHPh5Yqe FwUyVet+wHpA1c2goSW2AnaJIqt0FZ1hUBM+o3+9NFhlVcKtxPUC8QA4IUf+TpvAj5SE g6TboqcTflmXGT4OSag6FDkft0JIBO3XTfg2z9s9jmWOv+nIY0c0+jup/XZq8HY7stMp cOuhZMpLpI2MQW3OTJ4KGw46cXv5gDhckbDK8Z9jwTZG7Gdf6MiBrz9L8kxSyT9HZYOZ 0VDCzVlDP4eMPy39lomzoT2HfvSAWU+s+ZDYTspY0qcZrTlTelmszW/9Wg71261Bw/Gb 41hg== 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=ofv/mQjPD8gV6Ns4S27J46PcZU+GiEXbkmx16XPWTGI=; b=CzmebD+Jv9k7l6Z2frIFuVtpLXOMyQYsSfCxkZ7qXogu3xUbojq2zUgfn//+niu2M1 c3xJpSX8ROQa5yKCXLIs6xHAv/0D5kwnt68nLX2TAaA2NsgDJqVPNIpLdo+zlOqs/J/g LDq1KGkqwvoXKJi5QPaV+ltIAnAyhzVEvIjEHChZ9geZSyQ11Roc/hOVQ4iXdmkW+Gn5 JMyBD2deRCNnoGihK3gtKwa/1W9TAFXQUkGM+K+HmJr5BwjvUT6arAj+0vCIYFZiJrSj NUhaPhFrjZijruOYRYIDlAoRF14yjHILq/he8Pb6bsMASZgfjGYyYBKzBG/VThba1tIF yWbg== 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 c10si9546924ejr.522.2020.06.22.07.03.33; Mon, 22 Jun 2020 07:03:57 -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 S1729065AbgFVOBi (ORCPT + 99 others); Mon, 22 Jun 2020 10:01:38 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:39551 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728070AbgFVOBh (ORCPT ); Mon, 22 Jun 2020 10:01:37 -0400 Received: from oxbsgw03.schlund.de ([172.19.248.4]) by mrelayeu.kundenserver.de (mreue009 [213.165.67.97]) with ESMTPSA (Nemesis) id 1MrhLw-1j1t691Xc4-00neo3; Mon, 22 Jun 2020 16:01:25 +0200 Date: Mon, 22 Jun 2020 16:01:24 +0200 (CEST) From: Thomas Ruf Reply-To: Thomas Ruf To: Richard Weinberger Cc: Vinod Koul , Federico Vaga , Dave Jiang , Dan Williams , dmaengine@vger.kernel.org, LKML Message-ID: <501058700.545185.1592834484568@mailbusiness.ionos.de> In-Reply-To: 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> 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:vUZbxgo/OouGbsShJsc/bQjeMXYbOVzbSB/wP1nZxShgucZr6bZ 2AOEe4HJkldFD7CXfBjfJFyZ/JGuDL5HGVwhDSjKdPhSft9odUjIHmW1Ve5M3t4wA250NKD 0of89ztTKi1aCYli10qqAZTA9H8hQ8pOboNvMgJINUeibRo4iAnH+zDG/4pOhi9mMhCKDLT CMhdIQKwqXbYoqKd/b2aA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:zUA8ET7KTVw=:r4loVE6nt/IOlN/lgBbA4K bCtT3/AfVymyJQDSvzItt6gqdNlSnHr+4l3bnVpPFZdpblsLj4xb0rQqbiRiJjgfIb94/pL9S DB5nHWi+AQQU84OSXqAwkmii7l9axUa7dPyfpHOwfDdT09+qLej3ntdPj5eXHzRXMgB+zI5Y5 3soG6ETaRbW05NzOm84znyzerWYkAkj8YtQNJnBn+VrLqBPNTqgjFmfi3mzs4+DcpPvEU2bkC aSKvbRWSwbRQQC35eUfrDX4/NtLTf3xHO8GQD2jgARhvPPHl9aprf8CuRf/9HQAssZUvz0hcB KnD5utRKWB7AnBrMWHCEub8mSysgTu6WCS12ZaFL6DWr5T3X2xDRaQzvQFunjyqLBWPDZ6zmu dr4BntfS9x0EVeGwodMsn3ySn21YELlidDc4W8S/xkDtW5grJBTW9yqKgjDrWTefdCrP+W2o6 icGI2UF+eNMHm7aON1aU0VkITwOKv9lYEC4eHFMxTNymPjwrUb+oT+OiazPoMtr9ZQltc3yVL y1LJj9LD3VWtD/9jb/9UC7uD1ox1ny2nm9POXLEH4uxL4bVQgixb9GKRGljJL8TU1U6f/KCM6 mSYc1IbLle7CsUl1Obbr9Z5GNWzx9SwQ6vo7csy+K0OvnZ6pQfV+woD0m05AD0YaE3t29pz9K 9BW+3gb988wmRzbmfxwTRCrR1PidyFvI92KBdrLMYkwldleWL4ZTiKYIOmKO314HWtnd1N8rf hZZBq1wBwhP6u4YVrPgGN6I4o3ZqHXOTS8Mh5QFYZdpcp23NghsqdoWFeQOG0nGq3vBBaLiFh w0PEQfZK99k/3auzGsMDXuRhpwgCkEQASWlCjCrBBr8qq6Kv5o= 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:27 Richard Weinberger wrote: > > > On Mon, Jun 22, 2020 at 2:02 PM Thomas Ruf wrote: > > > 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 :-( > > > > 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 > > How do you preserve bounds? This is the main reason why vfio requires an iommu. Depends where the pointer "points to", i can detect: - virtually allocated user memory, the generated scatterlist is slit on page bounderies - contiguous pyhsical memory, in our case allocated by v4l2 (based on a dma without SG support), the generated scallterlist has just one entry sorry, i am not really familar with vfio :-( > > 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; > > Is this on top of uio or a complete new subsystem? Completely independent, just my own idea for a simple uapi. Best regards, Thomas