Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp568889ybe; Mon, 2 Sep 2019 06:07:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqx31rNk2UIs4GanFt+qgjfT8+ly35P9XUelZEOKfsNiqX/tODawWrvPLSpnZ6d2aQ9w/WxX X-Received: by 2002:a17:90a:3082:: with SMTP id h2mr13123236pjb.53.1567429630892; Mon, 02 Sep 2019 06:07:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567429630; cv=none; d=google.com; s=arc-20160816; b=Mn2MXGXxHOgoRZjnWhkKDv7zftvoYU7aAr5T10W0iFDFYjP2IXD4jl4sZ2YUwv8YZs qdoPDoxai85PhBnWnXHlyNg7DvYBxVzklhMMTaFPvCGkukH6tQjvcePo/rzrH+W07XMD 4FBaCgBJ6Cg6j9sUZOkdia6AUG4YYjqU0xAl4CPOz2kcpEqCh7bFQ7djcWlryTmXcQ6F b2/Gy1wBNikhpsSNCR16THdBacOoYqqQFt4Pgffj0nSwESFJQvNhTzNe8MkDbgiBd8EJ RG15lj6VIqPKw8kgJuoCK8klTdAHK9HHG7j1Kw7h86Hm5uicYT01NQWpy5A+d2yPw3M4 gaNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=d0S0r89/KU1c+xgF18IBbeKljG6PelXNtFabs09ex5Y=; b=upGBHBDCpkf/5lVxwqb6RRgipZ4hmcxkntmMZ3DXLKFly3MAgueDcYYgrMsShz3y8G cU9si+shSODxxtvKB/qvyvI8yk8lVoxp8lTToKGHyWuwV3vTVxWsclTdimE2tAUQkfs9 yM+Ekx5UpYT5zGiabZ1jORAQCvHLtTyhoxFXen3gHs+6OrFoq9KGN41Rz8NKtp/RP5XG zRFRzYhwyeIBbGcE3Oq4WJTQ8pu5/8MpXzV8Z/h54ay+0/p9kZ4+5zddK14gINoZCXWc y5iKV2WdakdGAJbDl0/hwuEEqv7Ly6NGpTFpO3HVBH55z76gy8yvQSdqJ58o7PhotQhg 9rVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="TJorY4Y/"; 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 a2si12061120pjw.103.2019.09.02.06.06.55; Mon, 02 Sep 2019 06:07:10 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="TJorY4Y/"; 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 S1730518AbfIBNEE (ORCPT + 99 others); Mon, 2 Sep 2019 09:04:04 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37322 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730469AbfIBNED (ORCPT ); Mon, 2 Sep 2019 09:04:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=d0S0r89/KU1c+xgF18IBbeKljG6PelXNtFabs09ex5Y=; b=TJorY4Y/35W+DIu+pX3EnCCx6g oIJF/ZU79+gImEf/XFmUnVpG1HAqT0f1SJqLhFWGRkQhVqhSPhMs4qiI2/BoFJ5T/4cKSONrT47gb Vl5t5qR7yAmFVh9rRVYZ7YrdLjLXTZWslCgG3J88Nd6GWoQxSB4SJgnAN+3qi5rvJ+k9JVCEvSwte POHdRFFTW4aqZ3Yc6jc5W4kiny6i0/tNndwuYLlNFfNHwyf9wHuo7x4tQ/JdcHJQnbcSI8jSnQQF5 DzQ+Ka6Lpb6mRShDakSiyaOBKO4En8u8A9CAduTF1uewWkoZoMqC+zmrgPUntE9ex612eJxGJrequ m2NqJW+Q==; Received: from [2001:4bb8:18c:1755:c70:4a89:bc61:2] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i4lzy-0001Qp-Gm; Mon, 02 Sep 2019 13:03:58 +0000 From: Christoph Hellwig To: Stefano Stabellini , Konrad Rzeszutek Wilk , gross@suse.com, boris.ostrovsky@oracle.com Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org, xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Julien Grall Subject: [PATCH 05/13] xen/arm: remove xen_dma_ops Date: Mon, 2 Sep 2019 15:03:31 +0200 Message-Id: <20190902130339.23163-6-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190902130339.23163-1-hch@lst.de> References: <20190902130339.23163-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org arm and arm64 can just use xen_swiotlb_dma_ops directly like x86, no need for a pointer indirection. Signed-off-by: Christoph Hellwig Reviewed-by: Julien Grall Reviewed-by: Stefano Stabellini --- arch/arm/mm/dma-mapping.c | 3 ++- arch/arm/xen/mm.c | 4 ---- arch/arm64/mm/dma-mapping.c | 3 ++- include/xen/arm/hypervisor.h | 2 -- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 738097396445..2661cad36359 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -35,6 +35,7 @@ #include #include #include +#include #include "dma.h" #include "mm.h" @@ -2360,7 +2361,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, #ifdef CONFIG_XEN if (xen_initial_domain()) - dev->dma_ops = xen_dma_ops; + dev->dma_ops = &xen_swiotlb_dma_ops; #endif dev->archdata.dma_ops_setup = true; } diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c index 2fde161733b0..11d5ad26fcfe 100644 --- a/arch/arm/xen/mm.c +++ b/arch/arm/xen/mm.c @@ -162,16 +162,12 @@ void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order) } EXPORT_SYMBOL_GPL(xen_destroy_contiguous_region); -const struct dma_map_ops *xen_dma_ops; -EXPORT_SYMBOL(xen_dma_ops); - int __init xen_mm_init(void) { struct gnttab_cache_flush cflush; if (!xen_initial_domain()) return 0; xen_swiotlb_init(1, false); - xen_dma_ops = &xen_swiotlb_dma_ops; cflush.op = 0; cflush.a.dev_bus_addr = 0; diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index bd2b039f43a6..4b244a037349 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c @@ -8,6 +8,7 @@ #include #include #include +#include #include @@ -64,6 +65,6 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, #ifdef CONFIG_XEN if (xen_initial_domain()) - dev->dma_ops = xen_dma_ops; + dev->dma_ops = &xen_swiotlb_dma_ops; #endif } diff --git a/include/xen/arm/hypervisor.h b/include/xen/arm/hypervisor.h index 2982571f7cc1..43ef24dd030e 100644 --- a/include/xen/arm/hypervisor.h +++ b/include/xen/arm/hypervisor.h @@ -19,8 +19,6 @@ static inline enum paravirt_lazy_mode paravirt_get_lazy_mode(void) return PARAVIRT_LAZY_NONE; } -extern const struct dma_map_ops *xen_dma_ops; - #ifdef CONFIG_XEN void __init xen_early_init(void); #else -- 2.20.1