Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp569232ybe; Mon, 2 Sep 2019 06:07:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyl9sxIkFCb7nz3fs/Wx2Ous5wH+pWnNgFb+SGjl+Z79WOl/RmeLYcO0J57rR/vBCnjCNHg X-Received: by 2002:a63:1020:: with SMTP id f32mr26082043pgl.203.1567429643325; Mon, 02 Sep 2019 06:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567429643; cv=none; d=google.com; s=arc-20160816; b=sB3JO1MALb5aMo2IMV8E8c0yYQtbxJI0q1NADH5QCOAfzT28q6VxMQEkxYzTLQeJNt 8yvgqSCI1gEhY8bD9aKgKkAtg91AK87LDvlp9YuOTASkJWHJeT2mXRadlK26OYEEGU1+ rFIiLJ9TumRrseSO6JyFrw1s3CUq3IcaCjt9r7lS56B79Q+eJrpOc4bBq0qmnL6YkDax HtaG61mArAjPwyn7u+jVqYi0qfRHG44JfUTytJAAxmaHoHsPfQm4TCnE/kyep25zjDAm si9X5OSDqB5zUhFBd23/PTJUsuiQT73AT1l+jz+l8XHYLU2gQg8kO8c47fOyupDjJau4 Syjg== 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=tHMFejYUnd6kztT2ho3qIS/kOF/x7QJDW+TD3i+blT9W43JgTUaleFJMJMr98fOLGk tYwF1/AEvCpkrtP+USKiudKvS5T5wjjuBrd/CdmdLa/KTv5JY/Xas9JcEFw/B3PexcHs 1YF4gacJU2OPR8SJ0b7+nSvtrsxh8YXHhbsOpSuVB+QGUXTh9c6GkREyys13abj52rfl /BXgGOPKT2iUzXIvvY+bGAU1aMextc1DbCXmJYzR3khU/YflRcgbdo+VxrcoS1Y/csWe AuGrCfS9bglJG48NrzIceLVh36o4iv/QMCz2rsEYOw2/FowHbfXEq4orZ/8gGqKgOiY5 Ubtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="R/7x+fHs"; 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 w12si11404557pgs.364.2019.09.02.06.07.07; Mon, 02 Sep 2019 06:07:23 -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="R/7x+fHs"; 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 S1730619AbfIBNEK (ORCPT + 99 others); Mon, 2 Sep 2019 09:04:10 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37930 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730469AbfIBNEJ (ORCPT ); Mon, 2 Sep 2019 09:04:09 -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=R/7x+fHstCiuPGDtTHZn3ll3Vq Bje0x8mwce/f0sqmLfpKhlzht358B2ZCHH5NQIfoFuM4jMAzL8nXsLiMLhuXBa0imvQ1m2YnjijdP m4damP9kMDPrjWt5jsPBW9o/EL1AfD2NDjGpsag7XmbClPAsxIcv/QuF5Zryeen6r3c6KjjSP7qe0 qv/l3JSmpx00SKgeMwjRNwlMp/NhSOLsl37N6vA4sslaJhHkNqFFFXNGxmxDHqiUPr8HKjrvv10Wh yusnBdKDI2O1aOBewMIYkw/jzkmP8HJQI6gU1gh+JtUdwrZdhzm23/WXdtwKfbDjrZnqdFeiFkesu poUiRbxA==; 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 1i4m04-0001Ym-VB; Mon, 02 Sep 2019 13:04:05 +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/13] swiotlb-xen: remove xen_swiotlb_dma_mmap and -xen_swiotlb_dma_get_sgtable Date: Mon, 2 Sep 2019 15:03:33 +0200 Message-Id: <20190902130339.23163-8-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 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