From patchwork Mon Jan 16 11:19:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 9518497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 758C860209 for ; Mon, 16 Jan 2017 11:22:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 510102836D for ; Mon, 16 Jan 2017 11:22:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 452422845D; Mon, 16 Jan 2017 11:22:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E43292836D for ; Mon, 16 Jan 2017 11:22:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cT5KU-0001Dk-9o; Mon, 16 Jan 2017 11:20:02 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cT5KT-00016F-1V for xen-devel@lists.xenproject.org; Mon, 16 Jan 2017 11:20:01 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 22/57-22326-06CAC785; Mon, 16 Jan 2017 11:20:00 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRWlGSWpSXmKPExsXiVRvkpBu/pib CYOFnOYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNeNn20WWgo+cFdfnTWZrYNzL0cXIySEkMJNR 4lFvUBcjFweLwEsWia09p9lBHAmBflaJ1rML2UCqJARiJF7deM8IYVdLbJq1kx2iW01i36HrL CANQgJzmCTmbvvECpJgE9CVuP7qAROILSKgJHFv1WQwm1nAS+L0wmdgtrCAv8TLX1vBbBYBVY mZp4+DLeAVcJe4trSDBWKZnMTNc53MIDangIdE36duNojF7hJ/+z6zTGAUWMDIsIpRozi1qCy 1SNfIXC+pKDM9oyQ3MTNH19DATC83tbg4MT01JzGpWC85P3cTIzC0GIBgB+PitYGHGCU5mJRE eY/pVEcI8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuAVX10TISRYlJqeWpGWmQMMcpi0BAePkgivM Uiat7ggMbc4Mx0idYrRmOPUjdMvmTh27br8kkmIJS8/L1VKnPfXKqBSAZDSjNI8uEGw6LvEKC slzMsIdJoQT0FqUW5mCar8K0ZxDkYlYV4ZkIU8mXklcPteAZ3CBHTKdZAveItLEhFSUg2MG1r z/y1fwN/ownIz+ZjByWjH9uMvOBaoneiL1NC1PHgpV/WbzdaoX+UqNY2e1Rt5bBvYpeN/PGLf t8XHfo3O+bA4A9n4V3Eus0KeTNvm/bKxYm2s8PY6Ia/v4grF2b9b5xY23jubtf4Je+WtivedT pffJ03mWPjXNNK1x4Hbu3DeqwPTVbqVWIozEg21mIuKEwGIZ2FquQIAAA== X-Env-Sender: andrii.anisov@gmail.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1484565599!52916098!1 X-Originating-IP: [74.125.82.66] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 27385 invoked from network); 16 Jan 2017 11:19:59 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-12.tower-21.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 16 Jan 2017 11:19:59 -0000 Received: by mail-wm0-f66.google.com with SMTP id d140so13641108wmd.2 for ; Mon, 16 Jan 2017 03:19:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vCABWn/BNrIRPZ9oMOvfL8LZhKQK3w7LtO3H7E4xXSs=; b=CzvdzqOnKhfTRiGsRspZLh7z3TUiVWQ6VCQggSQ3eOX4dWurA1L0TAhYXgj2RRASFK 2171iQtIYbUEtEVN7SIUe0eqoyZH12fjgY077XTE0JIU/Uh42thhw98BvxiVmairuIsQ GWLZnSR3Dun5MkSZQwBCCi6Gd/t/AFlmwLNvw+99LnvzyGtzvxHSEf/S4NB1uf++U4sE HACi+qImlGWCQiAzi0V/zJkfIDx7uQ8hVHAfGzyWYtBLfnIBWf7txbK1ZV0CoY+w4xwG MT0so3L/+gqBmXfkhdn1melX8woQ2UEjYFvf5bS2a0uwqjT6BMbGJmmew9gTBc1Ne/L6 Hr7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vCABWn/BNrIRPZ9oMOvfL8LZhKQK3w7LtO3H7E4xXSs=; b=KYcmWy6n6km5xSUiF7ZZ+GLLXf/4XWITBnyaFjD67CPM94kTmzJWnw3oPvbBDVg8Xt xHTZtf4BhPhyZf0n10/GrBOwpi24pV2Vv3jciIrxDxmZqaQ6rUA5n/O3dmscTg2OybRc a+5QXzeZjiNQlOul/+h3JkHreoG97KuRpqxs7LueV1EHKj5rwceSsEAaFEJ8Vr0jCEAy c2UNzmZ8aRnu1G711lrn9tCQQUxopI/rpZJxBQm3G+1Wk59sMloFfg64Mfoxw1ly3tGE qhuto7hzKXOIx4aadKWd+IydwRdNuQl7mPnbdqsb6ui+UpWsjOIGrqEGo1RspgW2z5zu PMfQ== X-Gm-Message-State: AIkVDXLWBhS4EXI3vcn4gIeByrkrkWQNScjkm19RhaAZQEVEMughSwCP8xLgNDP2WcENBQ== X-Received: by 10.28.167.204 with SMTP id q195mr11082800wme.19.1484565599151; Mon, 16 Jan 2017 03:19:59 -0800 (PST) Received: from aanisov-work.kyiv.epam.com (ll-54.209.223.85.sovam.net.ua. [85.223.209.54]) by smtp.gmail.com with ESMTPSA id l74sm28195272wmg.2.2017.01.16.03.19.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 03:19:57 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Mon, 16 Jan 2017 13:19:52 +0200 Message-Id: <1484565592-24897-3-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484565592-24897-1-git-send-email-andrii.anisov@gmail.com> References: <1484565592-24897-1-git-send-email-andrii.anisov@gmail.com> Cc: julien.grall@arm.com, sstabellini@kernel.org, andrii_anisov@epam.com Subject: [Xen-devel] [PATCH v2 2/2] swiotlb-xen: implement xen_swiotlb_get_sgtable callback X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Andrii Anisov Signed-off-by: Andrii Anisov --- arch/arm/xen/mm.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c index ff812a2..dc83a35 100644 --- a/arch/arm/xen/mm.c +++ b/arch/arm/xen/mm.c @@ -176,6 +176,16 @@ static int xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma, return dma_common_mmap(dev, vma, cpu_addr, dma_addr, size); } +static int xen_swiotlb_get_sgtable(struct device *dev, struct sg_table *sgt, + void *cpu_addr, dma_addr_t handle, size_t size, + unsigned long attrs) +{ + if (__generic_dma_ops(dev)->get_sgtable) + return __generic_dma_ops(dev)->get_sgtable(dev, sgt, cpu_addr, handle, + size, attrs); + return dma_common_get_sgtable(dev, sgt, cpu_addr, handle, size); +} + int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order, unsigned int address_bits, dma_addr_t *dma_handle) @@ -212,6 +222,7 @@ static struct dma_map_ops xen_swiotlb_dma_ops = { .dma_supported = xen_swiotlb_dma_supported, .set_dma_mask = xen_swiotlb_set_dma_mask, .mmap = xen_swiotlb_dma_mmap, + .get_sgtable = xen_swiotlb_get_sgtable, }; int __init xen_mm_init(void)