From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qZLcY0HZqzDq5d for ; Wed, 30 Mar 2016 06:36:28 +1100 (AEDT) From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org, Denys Vlasenko Cc: Konrad Rzeszutek Wilk , Sinan Kaya , linux-mips@linux-mips.org, linux-ia64@vger.kernel.org, Fenghua Yu , Catalin Marinas , Will Deacon , Max Filippov , Chris Metcalf , Paul Mackerras , "H. Peter Anvin" , Huacai Chen , Guan Xuetao , Stefano Stabellini , Marek Szyprowski , Jisheng Zhang , Florian Fainelli , Russell King , Aaro Koskinen , Michael Ellerman , timur@codeaurora.org, X86 , Ingo Molnar , Benjamin Herrenschmidt , Guenter Roeck , Konrad Rzeszutek Wilk , Akinobu Mita , cov@codeaurora.org, Bjorn Helgaas , Thomas Gleixner , Valentin Rothberg , Chris Zankel , Tony Luck , linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Dean Nelson , LKML , Ralf Baechle , "Suthikulpanit, Suravee" , Joe Perches , Andrew Morton , Robin Murphy , nwatters@codeaurora.org Subject: Re: [PATCH 2/3] swiotlb: prefix dma_to_phys and phys_to_dma functions Date: Tue, 29 Mar 2016 21:32:07 +0200 Message-ID: <6420021.rzhE3kJKJP@wuerfel> In-Reply-To: References: <1458252137-24497-1-git-send-email-okaya@codeaurora.org> <56EC1805.5060207@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Monday 28 March 2016 14:29:29 Konrad Rzeszutek Wilk wrote: > > diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c > > index ada00c3..8c0f66b 100644 > > --- a/arch/arm64/mm/dma-mapping.c > > +++ b/arch/arm64/mm/dma-mapping.c > > @@ -29,6 +29,14 @@ > > > > #include > > > > +/* > > + * If you are building a system without IOMMU, then you are using SWIOTLB > > + * library. The ARM64 adaptation of this library does not support address > > + * translation and it assumes that physical address = dma address for such > > + * a use case. Please don't build a platform that violates this. > > + */ > > Why not just expand the ARM64 part to support address translation? Because so far all hardware we have is relatively sane. We only need to implement this if someone accidentally puts their DMA space at the wrong address. There is at least one platform that could in theory use this because their RAM starts at an address that is outside of the reach of 32-bit devices, and a static IOMMU mapping (created by firmware) could be used to map the start of RAM into DMA address zero, to avoid having to use an IOMMU all the time, but it was considered not worth the effort to implement that. Arnd