From patchwork Tue Jan 10 16:44:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 9508153 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 10ED8601E9 for ; Tue, 10 Jan 2017 16:49:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03ECA28542 for ; Tue, 10 Jan 2017 16:49:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED33D28548; Tue, 10 Jan 2017 16:49:53 +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 A494228542 for ; Tue, 10 Jan 2017 16:49:53 +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 1cQzaP-0008G9-OG; Tue, 10 Jan 2017 16:47:49 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQzXG-00086b-Aq for xen-devel@lists.xenproject.org; Tue, 10 Jan 2017 16:44:34 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id 4F/47-18129-07F05785; Tue, 10 Jan 2017 16:44:32 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsXiVRvkpJvPXxp hcGevrsX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmrGxbzJzwVfOii2n17A1MB7k6GLk4hASmMEo cfvSRmYQh0XgJYvE5U+nmEAcCYF+VomFu9axdzFyAjkxEm/2rGSBsMslGtZNArOFBNQk9h26z gIxajaTRNu1WawgCTYBXYnrrx4wgdgiAkoS91ZNBrOZBbwkTi98BmYLA9l/LnwGW8AioCrxeP FJRhCbV8Bd4vntN2wQy+Qkbp7rZAaxOQU8JLbOOQ4U5wBa5i6xc4HZBEaBBYwMqxjVi1OLylK LdE31kooy0zNKchMzc3QNDUz1clOLixPTU3MSk4r1kvNzNzECA4sBCHYwful3PsQoycGkJMq7 7HNJhBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3ku8pRFCgkWp6akVaZk5wBCHSUtw8CiJ8PLxA aV5iwsSc4sz0yFSpxiNOaY9W/yUiWNH55qnTEIsefl5qVLivBdAJgmAlGaU5sENgsXeJUZZKW FeRqDThHgKUotyM0tQ5V8xinMwKgnzhoEs5MnMK4Hb9wroFCagUyLtikFOKUlESEk1MKpJ8V8 8Zrtd+YOocPz7S3VTnM38kgtn+oo6W7emqTyO7nBf5Db5cIVrx4tCkzm9FrMjT9284L7ZaFXw 25m5h87Kfb4wOy7vhbrERFfh6Pn1C9jvVC5eLyfisdSZ4cRRJa77cnefXnFYfHFjwPdV73YEL wz6z/XmXKB/dLNw7qF/835t/rt+H5cSS3FGoqEWc1FxIgBWte9iuAIAAA== X-Env-Sender: andrii.anisov@gmail.com X-Msg-Ref: server-10.tower-206.messagelabs.com!1484066671!62099310!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 50567 invoked from network); 10 Jan 2017 16:44:31 -0000 Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by server-10.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 10 Jan 2017 16:44:31 -0000 Received: by mail-wm0-f66.google.com with SMTP id c85so30837431wmi.1 for ; Tue, 10 Jan 2017 08:44:31 -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=czHQthKyf69jWCK+0ZvvTctgJ0f7mE0PM+InPaGzbfQ=; b=ooRgJrza8iDCxF6h5QtUVR+VT0oQXn17u+u3glsKDzSvdN6b4atI30eTMpAf0vULh/ GWkcACWLjXADGdyxCn02kM47O2UCXq1cwq/ijZEcWnfJAEpjPB2VM9ZsUaiNcFRwpBWa ocl240IFg2etxnk96kU6nWtnNmuG3KKOr4tQRqMoaKF0PlJ8X5l0BZWMccRwqWXX5C8Y G7QdC10YboZYKe6a4lYwpt+jo1HCQvCUFvEmYDl9vcg6WW6kJ6xTPkWspsrn+NK/l/bA vtLGgFpiRst7S8/KXqMRirw+e9XvT/o7dPunv9FNpFyusP/P9QNU6zs/xzGv0bx86NLZ 6N0w== 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=czHQthKyf69jWCK+0ZvvTctgJ0f7mE0PM+InPaGzbfQ=; b=IDlw4OTwK4nAwX4v0rRwt7ZCFHQywH0zX9BJEfoheiY07CR61ZDcI2NOMxIEmRVwsN wNTiNlqMpbmYwfv5aN7cS6iH8azbXNVmfFq32dngjBNG02h2cBkeHgp/OMnL9tteWIMC Lml+X2AAGDuY2AdBcdMVP5cw5jbavET+UBQyawIx3Nis7kh9inBPmuw32c4Zbz57rFfd h0ui0KdZqARcNMB6+pTi/4rydjiZbF+kRTbayc14kRxrx3HCo6LVZnjk3YLaBqClHZZQ h/Lrsc6G0Tchfm8badMPRQ4uNgM0OXeLwA86M1bB5+CBq/xJBxQO+SeVybKSjNyJjkko Eqkg== X-Gm-Message-State: AIkVDXKfMe3mZp+pNzzxxuMdMdOpVXCqWbVXZevnvXUTL79K/AxHdjx4MGsjDMCta2aP+g== X-Received: by 10.28.198.67 with SMTP id w64mr513374wmf.13.1484066671359; Tue, 10 Jan 2017 08:44:31 -0800 (PST) Received: from aanisov-work.kyiv.epam.com (ll-51.209.223.85.sovam.net.ua. [85.223.209.51]) by smtp.gmail.com with ESMTPSA id a8sm4099711wjq.44.2017.01.10.08.44.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Jan 2017 08:44:30 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Tue, 10 Jan 2017 18:44:27 +0200 Message-Id: <1484066667-12160-3-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484066667-12160-1-git-send-email-andrii.anisov@gmail.com> References: <1484066667-12160-1-git-send-email-andrii.anisov@gmail.com> X-Mailman-Approved-At: Tue, 10 Jan 2017 16:47:47 +0000 Cc: julien.grall@arm.com, sstabellini@kernel.org, andrii_anisov@epam.com Subject: [Xen-devel] [RFC 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 050cf34..4061dd0 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, + struct dma_attrs *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) @@ -213,6 +223,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)