Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp2842548imc; Sat, 23 Feb 2019 12:31:18 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibw27sgTUVh2aGSibF7ceXk3mtvPzda0PNtfwcLFivNQ+xn2892is5DTVsG3udfMyphVmOX X-Received: by 2002:a63:4b25:: with SMTP id y37mr10463034pga.181.1550953878582; Sat, 23 Feb 2019 12:31:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550953878; cv=none; d=google.com; s=arc-20160816; b=D5sABX11CnYnO8dxUbvOD5cW3w2uq2rygp5lOjuinleW5Z1LH3Gf39EPETi8Wzqwit mJmXXETwb3BuiKEnM+5Zkh69BCXbnlqEbkyu0uiSMfOtxWiLMniTCbKOlh3q4ddQ/I6N zo+ZpNa2h6ZNah1FEMH8be60wvO+NvzZeeXE9x/Zmnc9QYNGtbaHWJjQ9pnrRYItiY3z gaq31kL0Y28UpQeJRhypQM9NZeOhKM0t/+IzrI4KKo1kDhDCxAbwn/US6yrTpD7EFkVN Uo3hifxTlEhkHU3KoC+wxHb9Ljiw0CS5CapuANOPausG9WMHsq1GC1DUnWDJU/NAzeOt kMmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=gSzeeC+6wwQQir1GUZg/NZYmgto3lAEWG9HR/Yg8dis=; b=MvicTG128ix5A9WbcEAYJl/9NtsP8ko3gD3oheaRJepbEpbi7RRUyA2psp+DLi6Hys RiD8gRAF+tKJPetk52n82q6qiWfvjWHTRIgtn2as859TfyTm8HrEnxKjBXybAOLdNdkO p2QnCxANN8Cyg+aaEx44kSq4vRt3Bfpq8dOvA0Vw5ngZxjQuWRKKiTliH4F3qyUGV1lj 2ozkKOmWK5qtnH/Qef8ZiiV1rcgC328pO2Ax3i7Aui+twQ2fNh+0zZ9mdZyMJ4cmcUIo Y3CGCXjIrRWhf6uMQNmEje/OuOGVp4pOBoow4rWrmUOCnnEJVs5JYk5OLROtXjRWJTC+ ohfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=5fSDOWAt; 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 u8si4458801plz.97.2019.02.23.12.31.02; Sat, 23 Feb 2019 12:31:18 -0800 (PST) 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; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector1-xilinx-com header.b=5fSDOWAt; 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 S1727911AbfBWUah (ORCPT + 99 others); Sat, 23 Feb 2019 15:30:37 -0500 Received: from mail-eopbgr720061.outbound.protection.outlook.com ([40.107.72.61]:32662 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726125AbfBWUag (ORCPT ); Sat, 23 Feb 2019 15:30:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gSzeeC+6wwQQir1GUZg/NZYmgto3lAEWG9HR/Yg8dis=; b=5fSDOWAtg2iXyqCc119HCGAiL2KR1VmO2/uRXvKm9b4itckgGkuwIXOqrqvihN6Hf4ttIoUfSZbJBg4BueIodDYJsq3AwrovQmJxFm2iCkJAjPw1f3S3nNhV1dlF5f4XLUEyL3vlYCvQG3XFqRMntLXeHdhKyL+A32kPIGf5S+g= Received: from CY4PR02CA0002.namprd02.prod.outlook.com (2603:10b6:903:18::12) by DM2PR02MB1306.namprd02.prod.outlook.com (2a01:111:e400:50c8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.19; Sat, 23 Feb 2019 20:30:32 +0000 Received: from SN1NAM02FT014.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::200) by CY4PR02CA0002.outlook.office365.com (2603:10b6:903:18::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1643.16 via Frontend Transport; Sat, 23 Feb 2019 20:30:32 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT014.mail.protection.outlook.com (10.152.72.106) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1643.11 via Frontend Transport; Sat, 23 Feb 2019 20:30:31 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:60973 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1gxdwM-00009p-RR; Sat, 23 Feb 2019 12:30:30 -0800 Received: from [127.0.0.1] (helo=xsj-smtp-dlp2.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gxdwH-0002w8-Jz; Sat, 23 Feb 2019 12:30:25 -0800 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x1NKUOmL014447; Sat, 23 Feb 2019 12:30:24 -0800 Received: from [172.19.2.244] (helo=xsjhyunkubuntu) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gxdwG-0002vl-Ar; Sat, 23 Feb 2019 12:30:24 -0800 Received: by xsjhyunkubuntu (Postfix, from userid 13638) id 75B5C2C7382; Sat, 23 Feb 2019 12:28:41 -0800 (PST) From: Hyun Kwon To: Greg Kroah-Hartman , CC: Michal Simek , , , Cyril Chemparathy , Jiaying Liang , Sonal Santan , Stefano Stabellini , , Sumit Semwal , , Hyun Kwon Subject: [PATCH RFC 0/1] uio: Add dmabuf import ioctl Date: Sat, 23 Feb 2019 12:28:16 -0800 Message-ID: <1550953697-7288-1-git-send-email-hyun.kwon@xilinx.com> X-Mailer: git-send-email 2.7.4 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(39860400002)(396003)(346002)(376002)(2980300002)(189003)(199004)(6306002)(48376002)(8936002)(36756003)(6266002)(16586007)(5660300002)(52956003)(42186006)(356004)(6666004)(8676002)(54906003)(50226002)(81156014)(107886003)(103686004)(2906002)(14444005)(305945005)(81166006)(316002)(50466002)(110136005)(4326008)(44832011)(426003)(63266004)(90966002)(106002)(966005)(486006)(2616005)(478600001)(476003)(106466001)(51416003)(126002)(26005)(47776003)(186003)(336012)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR02MB1306;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;MX:1;A:1; MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 123df9b8-0c77-4fbb-4315-08d699cdc1b5 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605104)(4608103)(4709054)(2017052603328)(7153060);SRVR:DM2PR02MB1306; X-MS-TrafficTypeDiagnostic: DM2PR02MB1306: X-MS-Exchange-PUrlCount: 1 X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Exchange-Diagnostics: 1;DM2PR02MB1306;20:0pHNo50Oo6KfAkpYbknx/HmedrP+yoBjT0ydEMFHVrmDptfdFbTyNF6MnZRMd3D/U58/O0ML2MnghR7Oio4ivXokO3TOVEfeAyycuD/lu4qHLAEIyUIuDUzylz1o7VRPt7esgCbVO6wxKpS9a3cgaUpzCO/NyKN5Kjcw/eD5Sc89Ck0CML1TPRpayQvEU2ECogDkMCGqcpmbGeM/XpEQNl4vtRQLO7AJJVNrpC2aD41Ah9PS6zlLohvHZfYJ9a4n8bTK4tiu+5VU6bnXwl1iiB/87E/y6srK8U7qJKtrCtQBfnIKqreBvrK7Gd8leKAkU1D72jB9kIJfG1f9rjZmFyUYHeBmMrM3M+YL+t8cwhHs55v0h/wet1hpFMVt9vtgxl38TTzGLv3kXlssDXipBjF7TuppSSKjWFpetudOdX7WuOEQREDE1yrBIq9OQBKziosoYf3dhBlZSP1bsLY2CIkeI+2brmGllAtPgls8XgP6w5Vu9hjW7gRIgtu9zpxu X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0957AD37A0 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR02MB1306;23:0QQjLP0if4Hgf06JDkkwV3+kqsQuukDa5RG3MDwc9?= =?us-ascii?Q?NODWZXR2hWTOER23bJFQFH9SR+D4o/RuvjyhhQv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WarjyMctzGMcuFw1Nqc/U9XA6lKwW8ZkalRZAnff5kxrfOkC6RMNO84bu?= =?us-ascii?Q?W2uhHXgUOi+1CUQxLMAOmojiYelfL+oyCK7a30zbzlVxvAlGSezJUiNrJdyn?= =?us-ascii?Q?MfIaUOMaU2CJckWjBJeCFe2fh/M91XDgGy3a8JKIi75aeVJQ+wZn2nPoc/qr?= =?us-ascii?Q?K0396OhfFbTAs2lqnQdETs72pVeJMTpukThcztfiyJ4hxa0oEMQUw=3D=3D?= X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: M14tFwuAc8GNSQixj+8P1J+H4Scy7fIHDAI7P5TCz0AKCvLIQBSmZGp0RLBYQTPXOihxgXidrhGMfltBwkyXVEACRlY+B10tS6UG+/XkPRdfzwuQkNV/q3wdAjhaSqY78XrKuiLHHAiNqxFQRkoqqSRm2jrVYCB0EnuLJ7fxSrHvtPBrv2Eew0YlVHLf+GckTfc1BqVm6fP8S9f7NxnxTiiGYB6irGzmpG1LoKESgNwa9W81xiQYMhxnl6jAuQOdnpdIsDhfFiMdEfos2etO98c6OuOjgfafiTICMwmlm5aOlGO6giM76fT21jse162kauQGFrH4kOkKizWXotxadWK6+k7E95mAACkFmNsOX+LjCdR2RZMmwMwuvc3rRKPcO901YFma3CHkc/GHhYupETfoELtEosw2HQbjqpeKk1w= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Feb 2019 20:30:31.3298 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 123df9b8-0c77-4fbb-4315-08d699cdc1b5 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB1306 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I'm looking to enable platform independent device driver stacks on Linux. Currently, I have some driver built on top of Linux UIO [1], and possibly there can be more of such drivers: ex, soft IP drivers programmed on FPGA. Some device includes data movers such as DMA, and that requires some mechanism to import external buffers and program the data movers from user space. Thus this patch set adds a couple of ioctls to import the dmabuf and return required information back to user. This allows the user drivers to use dmabuf compatible external buffers: ex, it's tested with ION allocator. I'd like to understand if this is right approach which can be used to develop the user space software stacks further, especially because - adding new ioctls to generic uio - security concerns from exposing low level information: dma addr For example, vfio isn't option as iommu may not be available for all such devices on all platforms. So any feedback to move forward would be appreciated. Thanks, -hyun [1] https://patchwork.kernel.org/patch/10774761/ Hyun Kwon (1): uio: Add dma-buf import ioctls drivers/uio/Makefile | 2 +- drivers/uio/uio.c | 43 +++++++++ drivers/uio/uio_dmabuf.c | 210 +++++++++++++++++++++++++++++++++++++++++++ drivers/uio/uio_dmabuf.h | 26 ++++++ include/uapi/linux/uio/uio.h | 33 +++++++ 5 files changed, 313 insertions(+), 1 deletion(-) create mode 100644 drivers/uio/uio_dmabuf.c create mode 100644 drivers/uio/uio_dmabuf.h create mode 100644 include/uapi/linux/uio/uio.h -- 2.7.4