Subject: Re: memory with __get_free_pages and disabling caching

From: Benjamin Herrenschmidt <[email-masked]>
Date: Sat, 25 Mar 2006 12:02:51 +1100

> 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.