Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4149080ybl; Mon, 26 Aug 2019 06:17:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0P5yrxERqii7fqANDPfiGpWaRFCYguPBZYSY+oAqR5jbousqoHLgcLPHOVHNq1gixHA1F X-Received: by 2002:aa7:8a86:: with SMTP id a6mr10506727pfc.76.1566825459670; Mon, 26 Aug 2019 06:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566825459; cv=none; d=google.com; s=arc-20160816; b=wh61WXGH8hjC3UzWyO2wfTFXgbzwSrFcSVhF7A2c2+FAaWMoXkZM0KWU0TyhBcHuKH mG1npWtfuIBvzFmbSHGj/16viPyJiWNIdIaPJXcBjjVWaFyrFcjiWPIv6esCX5a5T4bw ZvTTuZfQJD4kMKoZQbTDxxFuHU8CodcOVoK65Po66L+TcDRuOt4nyTOadEENyAoZt35Z 7YlBBIIu4U+s7sSCFukeUzEh2h5E3SbeWIN6igwe5vYFgNGPcXcni9nlLSb4HAC7+nah CEBGqnJLzSdkK5h1AbqhbP/2QM/uZiKNZ58bWCRBbG1Jg4SaxDC4JyFIKTsAkSJ2miAO zBbQ== 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=ZJgCE8VaT9ExMOoCkwFiJUHvSb4wx5RyTACIYTHpVAQ=; b=gud7J/tneZpTafzPVJtP0GeslEATopY+zkl8vfjPWCj7wVZoBA429B4TTjZk3bZv+M FugKZgsl5XJNmVrAjWn5QcgjjpfASoD1q3TJel6pU0tBHDz6Eu5lN6iiJrB8zLkV2BKQ RYv9Panx1J6SfQVUXO+gmHq0xXF+bs1tYRAtUI+jdvS3bMvGLUDNr6vPlA5lB7pL1//i cpihVy82IZOksa5HQMHw6lRyMG+HH5DzI1aB/HUTKrK7TleMo95HHMNRKgMEnC97NS4t FppnbLvecCV1LgVmuu+63tWD3V1alJBY1aprA87396t1uoPMAgjF9LHOntOFS2aw5tnz Hs/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="ccx+/pUC"; 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 21si8773470pgk.492.2019.08.26.06.17.24; Mon, 26 Aug 2019 06:17:39 -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="ccx+/pUC"; 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 S1730972AbfHZMUE (ORCPT + 99 others); Mon, 26 Aug 2019 08:20:04 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:49326 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730652AbfHZMUC (ORCPT ); Mon, 26 Aug 2019 08:20: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=ZJgCE8VaT9ExMOoCkwFiJUHvSb4wx5RyTACIYTHpVAQ=; b=ccx+/pUC2Px9ZtFSoSgwf3fgQe MqQ62RGFxHrqG45mNd8ilMTmT4JrhEVAySuJy6LRSGtjnW3Hdh3a76KWYcGd7eF9mj/36vS3jh7cg IbF5puJUGBN0KCBAlfrGfxvFD5HCUO2eJn2A4KTo2IuQMUZh5TixAzSMkEe3GXaKRUPMmiwfDGZOX OWM7GWc2iB/J9WshSAIOdufyfr48m0oaA255syJMg7nBa+l6gQfX6MFGCYmqHU9+85QGgjglbtmPv AxOVXeiTzGEe+FjSFnGqXusM3izLelOWNSi8FgcAmgvNrDDOItvZPNMg+luCjfJjt2saMMOxH2Ndw 9cS5iyJg==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i2DyW-0002OV-UB; Mon, 26 Aug 2019 12:19:57 +0000 From: Christoph Hellwig To: Stefano Stabellini , Konrad Rzeszutek Wilk 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 04/11] xen/arm: remove xen_dma_ops Date: Mon, 26 Aug 2019 14:19:37 +0200 Message-Id: <20190826121944.515-5-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190826121944.515-1-hch@lst.de> References: <20190826121944.515-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 --- 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 14210ebdea1a..9b3a6c0ca681 100644 --- a/arch/arm/xen/mm.c +++ b/arch/arm/xen/mm.c @@ -163,16 +163,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