memory with __get_free_pages and disabling caching

Benjamin Herrenschmidt benh at kernel.crashing.org
Sat Mar 25 12:02:51 EST 2006


> Yes, that's how it works. After being allocated by the dma api
> routines, the direct map is never accessed. Accessing the same
> physical address via the cached direct map would cause serious
> problems but you aren't allowed to touch address space like
> that unless it's been allocated through a kernel allocator for
> your use.

That is still broken for at least 6xx CPUs ... they may well prefetch it
and you die...

For example, page A is a normal page allocated for kernel use, page B
just a after A is used by the DMA allocator for uncacheable accesses
(and is thus mapped twice). If something does a loop going through an
array in page A, you have no guarantee that some smart prefetcher &
speculative accesses will not bring bits of page B into the cache since
it's mapped and cacheable...

Ben.





More information about the Linuxppc-dev mailing list