Setting Kernel Allocated Memory Uncached on the PPC460
Josh Boyer
jwboyer at linux.vnet.ibm.com
Wed May 6 09:08:24 EST 2009
On Tue, May 05, 2009 at 04:16:45PM -0500, Timur Tabi wrote:
>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.
That isn't entirely true. You can always limit the memory mapped via the
kernel with mem= (or via a memreserve), and then have a driver ioremap the
now unused memory.
josh
More information about the Linuxppc-dev
mailing list