From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Fri, 12 Jan 2018 09:47:33 +0100 (CET) Received: from bombadil.infradead.org ([65.50.211.133]:53306 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23992336AbeALImwSqikJ (ORCPT ); Fri, 12 Jan 2018 09:42:52 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=c7DuEybEs8F7edtbdN4VvcyDfEtoPkOaoU/c5shCm4k=; b=s/5C7299FEkxYRhXjynMUdopK Fz0VhPswQcobpIhwbbjbu+K4PGySHPVqQK2V1rS1QIQ1befs/XZClq1GGrz6uoePEKN1rXjfHB0Ip FCmJVaZeikVVSmfRWyM2xdH05n1Uc43+gLi7WjT1gccTmQ6IDBFmBUYr4lVPonDbHHACGZC0GOsZ1 +7qJ1hScjGV3p/dNB5NRqjLkabyUmYY6YGUWjHQ6Znl86dp6EzNzQYtER23ftpPSodR/0e350+Fls dcWr0lj44bHAOS8CUuKEGYT5rsHP1Lpgudu+TyPPtPTrqt4xCgn794UNmCbRePg6GYe053Cz4UW7C uRQd0dXyg==; Received: from [188.21.167.3] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1eZuv5-00073a-Gs; Fri, 12 Jan 2018 08:42:36 +0000 From: Christoph Hellwig To: iommu@lists.linux-foundation.org Cc: Konrad Rzeszutek Wilk , linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-cris-kernel@axis.com, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-metag@vger.kernel.org, Michal Simek , linux-mips@linux-mips.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, patches@groups.riscv.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, Guan Xuetao , x86@kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: consolidate direct dma mapping V4 Date: Fri, 12 Jan 2018 09:41:58 +0100 Message-Id: <20180112084232.2857-1-hch@lst.de> X-Mailer: git-send-email 2.14.2 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 62064 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: hch@lst.de Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips Almost every architecture supports a direct dma mapping implementation, where no iommu is used and the device dma address is a 1:1 mapping to the physical address or has a simple linear offset. Currently the code for this implementation is most duplicated over the architectures, and the duplicated again in the swiotlb code, and then duplicated again for special cases like the x86 memory encryption DMA ops. This series takes the existing very simple dma-noop dma mapping implementation, enhances it with all the x86 features and quirks, and creates a common set of architecture hooks for it and the swiotlb code. It then switches a number of architectures to this generic direct map implemention. Note that for now this only handles architectures that do cache coherent DMA, but a similar consolidation for non-coherent architectures is in the work for later merge windows. A git tree is also available: git://git.infradead.org/users/hch/misc.git dma-direct.3 Gitweb: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-direct.3 Changes since V3 - new patch to fix an off-by-one in mips dma_capable Changes since V2: - fixed a few patch description typos - fixed a few printk formats - fixed an off by one in dma_coherent_ok - add a few Reviewed-by/Acked-by tags. - moved the swiotlb consolidation to a new series - dropped a few patches for now to not overwhelem the x86 maintainers. They will be resubmitted in the next merge window