Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp802084ybe; Thu, 5 Sep 2019 06:14:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzeKEDsTTGfvmjg0+pXqJPhz8O30aYhZeRM5ElJbqMu8y4pUgKzeA5rviKUkIbGXcGK8XHZ X-Received: by 2002:a63:6c4:: with SMTP id 187mr2852447pgg.401.1567689274328; Thu, 05 Sep 2019 06:14:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567689274; cv=none; d=google.com; s=arc-20160816; b=d+bNrnLi+SwbfU1KReWio8FTD4TGwlEaEg/WWDAffMYiVsPUzbwXQFLO2MtSB/w5V8 ItTJNdTbz5PqTFzZPEXf/uKlMgTmE9eGdq6Zk59off+qfY51U3Rq9XIX9OB3KvrK/q8+ Ix5dQMu3/HZie6yhoirPIChnYjCu10aPIKdT+GRzxjZ7nVGkcVlsyi1JGI71vlxhPnzm aDudHyC32dBrd4T/gsfSrDXJwRf4RLcZdyicFzfkGllgfB0mL+ZEfZiZ6H68Kv8bucuC 4ncCWf/8LkhSCyyYSSJM+3O53QkzmlQqbJ74f6ziRyD0gDTEAyK3BSqGbrc23UVhASSh kwMw== 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=ta9M2b2y7wj8yOyfpMAIMWmSlpU0UyW1ZNcRY8yDGCI=; b=HH3bANyAgzizxNnEi3F0P5Gu6uQN4n8bV6LWwLUHR1crBA7HQhbuayhBSgdi3NAufa PCU41MMNX5C58BLkq7pKfhg3K/KOAVVWTNjxcXoYYwBlj68ysUV92rqoSMmvRMfS3XM2 FtXFHCRguRjruQat72G07k07QLdfCg6ML8mSXRBnj0fe7jYWa8Z7Dyraf2G4gFixXFtZ 9sgmbgIskch/U6IqDPN9mnVHkQ0aspbFJ2p8fKgj13antpHYXObUQLZ1KJT7tB1Fa+6N kURSn5q8U5D7zqnFaVsighfF0n5ZYf+oBxYPhce142U03XLRMqYepP6WQR8KFIpvJLHR /7nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=AwL8wt4p; 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 i4si1758928pgj.558.2019.09.05.06.14.18; Thu, 05 Sep 2019 06:14:34 -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=AwL8wt4p; 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 S2388740AbfIELlI (ORCPT + 99 others); Thu, 5 Sep 2019 07:41:08 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:51724 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388731AbfIELlG (ORCPT ); Thu, 5 Sep 2019 07:41:06 -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=ta9M2b2y7wj8yOyfpMAIMWmSlpU0UyW1ZNcRY8yDGCI=; b=AwL8wt4pWATWp3lmEcCq8Od5sT LLtjMGYUO8ITIwvHTzrZjk4T8wmEHxwQx4o5TMg99IrQgIYtJM5pkBRZht6MIf0HXdW/daTjGOPkc 2fdigBEBZj/Wd84pb/LwODoQ5uSfOx726vfgX5EACmUC/QJmVbzfuclAOcKhk33gpcjPVk+dViz0N oSciaEU3UqX1UT6TZhMzHyWqHmttmyEzkh3ER57mDQFLqSlS0oyxFJtjYaTi39ZL3Z5IuT3rUnxHc PMrftY03g3Ukh+xblnzyEnBGX0tftexx3FJfB7TlwBav2Bx4qgBCRCrgxIlYAUKY/T6M1/JPkfQIh 4KXKrmHw==; 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 1i5q8L-000519-Cd; Thu, 05 Sep 2019 11:41:02 +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 Subject: [PATCH 07/11] swiotlb-xen: remove xen_swiotlb_dma_mmap and xen_swiotlb_dma_get_sgtable Date: Thu, 5 Sep 2019 13:34:04 +0200 Message-Id: <20190905113408.3104-8-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 There is no need to wrap the common version, just wire them up directly. Signed-off-by: Christoph Hellwig Reviewed-by: Stefano Stabellini --- drivers/xen/swiotlb-xen.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index eee86cc7046b..b8808677ae1d 100644 --- a/drivers/xen/swiotlb-xen.c +++ b/drivers/xen/swiotlb-xen.c @@ -547,31 +547,6 @@ xen_swiotlb_dma_supported(struct device *hwdev, u64 mask) return xen_virt_to_bus(xen_io_tlb_end - 1) <= mask; } -/* - * Create userspace mapping for the DMA-coherent memory. - * This function should be called with the pages from the current domain only, - * passing pages mapped from other domains would lead to memory corruption. - */ -static int -xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma, - void *cpu_addr, dma_addr_t dma_addr, size_t size, - unsigned long attrs) -{ - return dma_common_mmap(dev, vma, cpu_addr, dma_addr, size, attrs); -} - -/* - * This function should be called with the pages from the current domain only, - * passing pages mapped from other domains would lead to memory corruption. - */ -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) -{ - return dma_common_get_sgtable(dev, sgt, cpu_addr, handle, size, attrs); -} - const struct dma_map_ops xen_swiotlb_dma_ops = { .alloc = xen_swiotlb_alloc_coherent, .free = xen_swiotlb_free_coherent, @@ -584,6 +559,6 @@ const struct dma_map_ops xen_swiotlb_dma_ops = { .map_page = xen_swiotlb_map_page, .unmap_page = xen_swiotlb_unmap_page, .dma_supported = xen_swiotlb_dma_supported, - .mmap = xen_swiotlb_dma_mmap, - .get_sgtable = xen_swiotlb_get_sgtable, + .mmap = dma_common_mmap, + .get_sgtable = dma_common_get_sgtable, }; -- 2.20.1