Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757976AbcC2TgR (ORCPT ); Tue, 29 Mar 2016 15:36:17 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:51802 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753970AbcC2TgN (ORCPT ); Tue, 29 Mar 2016 15:36:13 -0400 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> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <1458252137-24497-1-git-send-email-okaya@codeaurora.org> <56EC1805.5060207@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:tqnwciplf3N9FU4xAL9BHpvbwDqN+UQyVwaClxmX7+x/D+pFWTw WpXRc87/OqIzDIez85/3q/B73zeQYFX3q8eZrfrcDUI5y2VpQLaFnIOAuBKi78wIbyqQRTb mXfAAioky2HsrLnoMi+xnjTZTEKXTid8UMurmgn+dB7LEO9A52Uk4+T+L7zarXB/N5auT7q B2rjZqjDFmzfSCH2zW0NA== X-UI-Out-Filterresults: notjunk:1;V01:K0:mjFFRkxZ4e0=:wgDPle4R7k5GpQmxJ1cQpa OEApsS/XivD39HUjsNwAZW16PGy7/w98rxeEGdjTQKcDEKhVCIK8fWEzD3CWtajfnlZePQUho 4EDWzMO9H7TwuRwmmnw5B2s3qd3l9RWEobAwQu02VJSt1s720w+KrhOEb7Qkn7AsqRN3+XgLR EEV73dEL7Jv2+XgcrDEcp0qcHPUtDu6pEK33LwWVfODASn9R0htXa/4aP2EctphjMk2ERIeNS rZEiloYHbhAmT7Vg3cXUIbZxwkzQ9YKDJ8UtR8AsxAFR/82PvM+nm4Kgfb93h2gGQmAgRcqZO b0+t+euf9zsGZBUsymJWK4Im6nQ6z8+r2voVgIKA6m0Ay46WbMW2o45hFvZLgZ+aZuVZBLs21 8KqX7gYUH7VDSU5TPU5ni9sjAQ/6F8A3HJ2O8+NIzIoTIcS06PwDkNyme6Ug7RTkfj7ZcFJSU vxHuYWWQ8cQ8DBlw0aawhBn8K7TQ9Qsym25wvjwDKvF2eSkKcuYZc8FSD08hUgqgJSFZaiBGj YhjW7Iy9kx3dwIlUp1cWxrOAVbabhV7K98ZpKNEgU7+MwOENjDhhaeZGQYAgx2ZUq+5Phya8P SYKqUHYjvWRx+9PmLj/C3GhT5TlZ5qGWemInQEwo4v7cl4AisWRdt0WbqaoO2BzKpNMzAU8no v+6LIcwIatbUDYumGo/GFrFGEcTJ08z4UpvgwvZsPrW4Z1MKjslaM3Xf70sclObnGkscK/PJq 6DJTFXJMKKBhRhCp Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1237 Lines: 30 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