Re: Does kmalloc always return address below 4GB?

David S. Miller
2002-03-05T12:01:44Z

From: "Adam J. Richter" <adam@yggdrasil.com>
Date: Tue, 5 Mar 2002 03:52:14 -0800

| If you acquired your memory via the page allocator
| (i.e. __get_free_page*()) or the generic memory allocators
| (i.e. kmalloc() or kmem_cache_alloc()) then you may DMA to/from
| that memory using the addresses returned from those routines.

It might be a good idea to rephrase it. If I knew what that
sentence I would propose a patch to the DMA-mapping.txt file, but I
honestly don't know what proposition that sentence is supposed
to convey. If there really is no guarantee that this sentence is
conveying, then I guess the sentence should be deleted.

Probably it should qualify what it means with "and you used
GFP_KERNEL". Because that was the intention.

I'll fix that.

However, you can use GFP_HIGH memory with pci_map_page _iff_
you set your DMA mask to allow 64-bits.

The original impetus for that quoted bit of DMA-mapping.txt
was to make sure nobody used vmalloc() or kmap() pointers.