Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp988019ybe; Thu, 5 Sep 2019 08:44:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqx501thfB48FmFFB5huwNnjFCB764czBVDvpuHucLAtYaANvia3Rrsd+83JBepcGQeFQRBU X-Received: by 2002:a63:714a:: with SMTP id b10mr3903493pgn.25.1567698284353; Thu, 05 Sep 2019 08:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567698284; cv=none; d=google.com; s=arc-20160816; b=NJ+/QFd61MoqFhhV54H1DqM5SJayW/K3yyr/lBNV4Tr/n4mvQsFa4aynP3iSjxwYWn +XaPojb4KTOecG9a3LVpn1nGdkhZCkLpbKu5DSbwx81SEz/uuvSoOAPx/DzG8IUM/hA3 Gh2eukacJnTGfoefk2WZqQklR8Fkt/AaiHT5DMSdCrBTFJjeGfOaHxDQ1Li/DPN/iFyi 5NtxJux/ax1YZPygkXONVwcjlSZb23jaaW0gPcr9u0mK49BYkkLaJgd6PL8icxOy4/uE 9Gghss6hh3uupp6M78kmga9VXt0g/Nl/IniKs1cno9+vS8X/+Y/j3SXffVO38fo7Ve10 tQOg== 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=Fi5tWT2LrMc//vKdg2NoHmI4C8AuMxsoDk6xSLHSXOu1E4Y19ls/L9e4ABAQlaMNxs XFd2SL8pijwHumceyDEgBhxQwQTaSL0ed/F/uvN8ONxJZv/p7KgCPsNPZFqR2O8CbtaB c2O/j+bdOmHPRHbVgQnbl8X9J6EGpFnkiHHn5rFCPsnDHKDwgT1NHRNr8pyimhBiIxmL eMbbaUzTZJIIGDOhtfThd87dA516W3/S5SrZhKvI4Hw1sPBTtFa9UELdMT+1AE9jJkkE 5A5SM+J4AEuWQPCF9RfUYwyFg2T+mCDyZHS0vuGmP2nZu2C6ajltyqLd8jKBLtMEman/ RN+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=pufavMrD; 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 h11si2133137pgr.555.2019.09.05.08.44.14; Thu, 05 Sep 2019 08:44:44 -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=pufavMrD; 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 S2388714AbfIELlD (ORCPT + 99 others); Thu, 5 Sep 2019 07:41:03 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51418 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732345AbfIELlC (ORCPT ); Thu, 5 Sep 2019 07:41:02 -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=pufavMrDsS2djSBrQkds3tR7jY 79p2t5CK7q64rwkBXt2Tr6lX/MwSDrYW2j2RwN8CBkn9jQh5xyvKOEgPvRJ9vKeftkk7RxsvhNU9c wiNB1nkUBbXdv6MY/ly3Fli68/bdIh+tBFdWdci3UgkikH1m0mxM4i4KVdouXMZwh4gu457PW/oVy H8fctCgcOBno0gZ5t55647LrbteBYhmkt4RmZ8tfzL5hpRNe7835j0N7j/UBBlU6sgpfc6Gg1FikG RcgPPPfBzyXjaI9TTurxjLkGgUDpNtbqWiXEjxxuE3kP6K+mhLbX78oF+UQ/SDxQvTYoRRw5oq+RJ c4orDZ4A==; Received: from [2001:4bb8:18c:1755:a4b2:9562:6bf1:4bb9] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i5q8F-0004vY-MX; Thu, 05 Sep 2019 11:40:56 +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/11] xen/arm: remove xen_dma_ops Date: Thu, 5 Sep 2019 13:34:02 +0200 Message-Id: <20190905113408.3104-6-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190905113408.3104-1-hch@lst.de> References: <20190905113408.3104-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