Subject: Re: RMO ? (in the prom_init.c)

From: Benjamin Herrenschmidt <[email-masked]>
Date: Fri, 11 Sep 2009 17:39:47 +1000

On Fri, 2009-09-11 at 15:33 +0900, HongWoo Lee wrote:
> Hi ~
> 
> Can anybody tell me what the RMO is ?? in the linux kernel. 
> (arch/powerpc/kernel/prom_init.c)
> Through googling and guessing, I found "Read Memory Only" and "Relaxed 
> Memory Order".
> But none of these are not properly understood in the context.

It's actually a bad name and should probably be "RMA" , aka Real Mode
Area.

This is a "feature" of the POWER architecture for servers, when running
under a hypervisor. Not all of memory can be accessed when the processor
is in "real mode" (MSR:IR and/or DR off).

The reason is obvious, since the OS doesn't have access to real memory
but virtualized logical addresses. And since all of the virtualization
normally goes through the MMU hash table, "real mode" accesses that
bypass the hash table are problematic to allow in an OS.

The "solution" used by those processors is to have a HW feature that
allows a chunk of physical memory to be made accessible to the partition
in "real" mode, which is called the RMA.

That means in practice that the kernel can only access that portion of
it's logical address space while in real mode, it needs to use
translations in the hash table to access the whole of it.

The value in prom_init.c is used to constrain some allocations to that
range for things that will be accessed while running in real mode (such
as RTAS), though it's also abused to constrain those allocations to a
subset of memory even without hypervisors to work around things like
firmware bugs etc...

Cheers,
Ben.