[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whnz4Kty6cas11bc2Gh=9zTzeeRS2k=dV9Hfc4B=xnHkQ@mail.gmail.com>
Date: Wed, 28 Nov 2018 10:00:06 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: linux@...linux.org.uk
Cc: Christoph Hellwig <hch@....de>, linux-arch@...r.kernel.org,
linux-ia64@...r.kernel.org, linux-parisc@...r.kernel.org,
robin.murphy@....com, "the arch/x86 maintainers" <x86@...nel.org>,
Linux List Kernel Mailing <linux-kernel@...r.kernel.org>,
iommu@...ts.linux-foundation.org, linux-alpha@...r.kernel.org,
xen-devel@...ts.xenproject.org,
David Woodhouse <dwmw2@...radead.org>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: remove the ->mapping_error method from dma_map_ops V2
On Wed, Nov 28, 2018 at 9:45 AM Russell King - ARM Linux
<linux@...linux.org.uk> wrote:
>
> > I don't think this is a huge deal, but ERR_PTR() has been hugely
> > successful elsewhere. And I'm not hugely convinced about all these
> > "any address can be valid" arguments. How the hell do you generate a
> > random dma address in the last page that isn't even page-aligned?
>
> kmalloc() a 64-byte buffer, dma_map_single() that buffer.
No.
You already cannot do that kmalloc(), exactly because of ERR_PTR().
Not all memory is accessible even to the kernel. If you have memory
that shows up in the last page of phys_addr_t, you just mark it
reserved at boot-time.
Which is what we ALREADY do for these exact reasons. If the DMA
mappings means that you'd need to add one more page to that list of
reserved pages, then so be it.
The whole argument of "every possible piece of memory is DMA'able" is
just wrong.
Linus
Powered by blists - more mailing lists