Setting Kernel Allocated Memory Uncached on the PPC460

Timur Tabi timur at freescale.com
Wed May 6 07:16:45 EST 2009


On Mon, May 4, 2009 at 1:55 PM, Judd Gilbert <JuddG at tanisys.com> wrote:
> I have a driver which maps some kernel allocated memory to user space which
> works, and now I am trying to set that memory non-cacheable, on a power PC
> using the Denx ELDK (linux-2.6.24) on a PPC460ex.

Because of the way the kernel maps main memory, you cannot do this.
It is a violation of the PowerPC architecture to map a particular
memory address as both cached and uncached (using different TLB
entries) at the same time.  When the kernel boots, it uses large
mappings to map all of memory as cached.  There is no mechanism to
punch holes in these mappings.  Therefore, if the memory is already
mapped cached by the kernel, you cannot remap it as uncached.

The only way around this is to use high memory, which is not mapped by
the kernel normally.  You can "bring in" a high memory page and map it
uncached.  However, I don't think there is a way for you to manually
specify certain memory to be high.

-- 
Timur Tabi
Linux kernel developer at Freescale



More information about the Linuxppc-dev mailing list