From patchwork Mon Jan 16 11:23:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 9518503 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 C9FDF60209 for ; Mon, 16 Jan 2017 11:26:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6A922844A for ; Mon, 16 Jan 2017 11:26:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9ACDB28462; Mon, 16 Jan 2017 11:26:01 +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 25AC52844A for ; Mon, 16 Jan 2017 11:26:01 +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 1cT5O6-00022u-4k; Mon, 16 Jan 2017 11:23:46 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cT5O5-00022b-5T for xen-devel@lists.xenproject.org; Mon, 16 Jan 2017 11:23:45 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id F8/B1-19998-04DAC785; Mon, 16 Jan 2017 11:23:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCIsWRWlGSWpSXmKPExsXiVRvkqGu/tib CoG+2vMX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmvGz7SJLwUfOiuvzJrM1MO7l6GLk5BASmMEo 0fJYv4uRi4NF4CWLxI0tb5hAHAmBflaJSe8PMIJUSQjESHSsnQZlV0u0t3ezQXSrSew7dJ0Fw p7DJDF9lQaIzSagK3H91QMmEFtEQEni3qrJYDazQLLEpU1nWUFsYQF/iZe/tgLFOYA2q0rMPx ELEuYVcJe4drWRDWKVnMTNc53MIDangIfEko8/WCFWuUt0fD/FMoFRYAEjwypGjeLUorLUIl1 DE72kosz0jJLcxMwcXUMDY73c1OLixPTUnMSkYr3k/NxNjMCwYgCCHYwrtnseYpTkYFIS5T2m Ux0hxJeUn1KZkVicEV9UmpNafIhRhoNDSYJXfHVNhJBgUWp6akVaZg4wwGHSEhw8SiK8amuA0 rzFBYm5xZnpEKlTjMYcp26cfsnEsWvX5ZdMQix5+XmpUuK8M0AmCYCUZpTmwQ2CRd4lRlkpYV 5GoNOEeApSi3IzS1DlXzGKczAqCfNeAJnCk5lXArfvFdApTECnXAf5gre4JBEhJdXA2HP9zeZ 5H/qFeHjEXGpkL/7U/mZ2cwajZ2zjF2Hff7OXFos3eT++wlV9/8rffY71N83kLT/9CG951reB sav4CWestn2CkfmC0BsLZjy0bnN29S7i32/p+z6k7vW01Hsf7askw3a+aT2wuSlA8xa3zMedu ju6Mn3Fbus5fS72UxFwEi1S3zBfiaU4I9FQi7moOBEArkUYd7cCAAA= X-Env-Sender: andrii.anisov@gmail.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1484565823!80817320!1 X-Originating-IP: [74.125.82.65] 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 11162 invoked from network); 16 Jan 2017 11:23:43 -0000 Received: from mail-wm0-f65.google.com (HELO mail-wm0-f65.google.com) (74.125.82.65) by server-8.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 16 Jan 2017 11:23:43 -0000 Received: by mail-wm0-f65.google.com with SMTP id c85so29892083wmi.1 for ; Mon, 16 Jan 2017 03:23:43 -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=O6wSSWX63AIMbPnVjIOy4880e/b8CEdypDGQY+buVmiVzl8MH2dgSHq4UgyJci4ic3 OHTWWxK8DhmCJDBNpm9zRccNOFRL4oF6lagqORaWqbbeuzygFZBFKxErRqaxGgOI3Yw4 dBjWJc5HhExm6C2m81ItMnA2XBeuu2UYJ2ihaJQGyCCYsUMTHOI6GixgTiguLB4OOj3b LatxzOLCQrWsUTTRg9d2loJuJ3AghXkc60gB90p09G72oYGIvjzesRAkTPIjhciWcRfn E3LPfi1XwgVwW/TDhaxG+JacUbFner8L5GtDYqsvdNSQPmKnuLmz5ydf1IHfUOuZgPFH 6wsQ== 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=a6NEJTWseCNePdTi6e5y4biuiG47Q+MXTuRQPNMjs0tpzGgW6uzSeDG9lnKt5m704x TylaF45Nfc+zWsSF4wqD9Tz/suST2PZQkcX2uQ33eGulA1FIBzhFSnICtxiZtOp3d+IM E4MN8KFeZzzc0aM0ticLmoUm8rfHuTy8ljFPCjrRKaf0H5fz3VEWOZsCh+6mraXPniY4 IcjQM/OkxbxxmHTCuElP2EBxl52Zrr3vXdsd6g7e3MGI93KsSm750W7zal/vg8hK7RdH DQ8EBY4ExRkYDFYdk/TyKydnLJFarDJPCOZhMJgg4e7jHLMUc8lVTXzpSObyBWkQg8R6 xTWA== X-Gm-Message-State: AIkVDXK7o3FDG3szjUtE6K8hk5IkM70Bv3kw/+PA/oMI44CIgzaX/+gHZK+0gn8Nx44KcA== X-Received: by 10.223.168.87 with SMTP id l81mr22359386wrc.194.1484565823045; Mon, 16 Jan 2017 03:23:43 -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 d14sm2519261wmd.19.2017.01.16.03.23.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Jan 2017 03:23:42 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Mon, 16 Jan 2017 13:23:35 +0200 Message-Id: <1484565815-25015-3-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484565815-25015-1-git-send-email-andrii.anisov@gmail.com> References: <1484565815-25015-1-git-send-email-andrii.anisov@gmail.com> Cc: julien.grall@arm.com, sstabellini@kernel.org, andrii_anisov@epam.com, konrad.wilk@oracle.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)