Re: [PATCH 2/3] swiotlb: prefix dma_to_phys and phys_to_dma functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, Denys Vlasenko <dvlasenk@xxxxxxxxxx>
- Subject: Re: [PATCH 2/3] swiotlb: prefix dma_to_phys and phys_to_dma functions
- From: Arnd Bergmann <arnd@xxxxxxxx>
- Date: Tue, 29 Mar 2016 21:32:07 +0200
- Cc: Konrad Rzeszutek Wilk <konrad@xxxxxxxxxx>, Sinan Kaya <okaya@xxxxxxxxxxxxxx>, linux-mips@xxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, Fenghua Yu <fenghua.yu@xxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Will Deacon <will.deacon@xxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Chris Metcalf <cmetcalf@xxxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Huacai Chen <chenhc@xxxxxxxxxx>, Guan Xuetao <gxt@xxxxxxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>, Jisheng Zhang <jszhang@xxxxxxxxxxx>, Florian Fainelli <f.fainelli@xxxxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxxx>, Aaro Koskinen <aaro.koskinen@xxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, timur@xxxxxxxxxxxxxx, X86 <x86@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Guenter Roeck <linux@xxxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Akinobu Mita <akinobu.mita@xxxxxxxxx>, cov@xxxxxxxxxxxxxx, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Valentin Rothberg <valentinrothberg@xxxxxxxxx>, Chris Zankel <chris@xxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, linux-pci@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, Dean Nelson <dnelson@xxxxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, Ralf Baechle <ralf@xxxxxxxxxxxxxx>, "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@xxxxxxx>, Joe Perches <joe@xxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Robin Murphy <robin.murphy@xxxxxxx>, nwatters@xxxxxxxxxxxxxx
- In-reply-to: <CACJDEmrzKOExg-Rchjy2hfVzkzbCZ=WNn4Bu3EVgim748VvRig@mail.gmail.com>
- List-id: <linux-ia64.vger.kernel.org>
- References: <1458252137-24497-1-git-send-email-okaya@codeaurora.org> <56EC1805.5060207@codeaurora.org> <CACJDEmrzKOExg-Rchjy2hfVzkzbCZ=WNn4Bu3EVgim748VvRig@mail.gmail.com>
- User-agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; )
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 <asm/cacheflush.h>
> >
> > +/*
> > + * 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
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]