Re: [PATCH 11/26] KVM: PPC: Make RMO a define

Alexander Graf
2010-06-29T07:39:55Z

On 29.06.2010, at 09:32, Segher Boessenkool wrote:

>>>> On PowerPC it's very normal to not support all of the physical RAM in real mode.
>>>
>>> Oh? Are you referring to "real mode limit", or 32-bit implementations with
>>> more than 32 address lines, or something else?
>>
>> The former.
>
> Okay. In that case, the hypervisor can usually access all of physical
> ram directly, unless it limits itself; and a supervisor gets either
> no real mode access, or all ram, or some part -- whatever the hypervisor
> likes.
>
> If you access outside of ram, you will most likely get a machine check.
> Depends on the implementation (like most things here).
>
>>> Either way, RMO is a really bad name for this, since that name is already
>>> used for a similar but different concept.
>>
>> It's the same concept, no? Not all physical memory is accessible from real mode.
>
> I think you're looking for "real mode limit":
>
> The concept is called "offset real mode".
>
> RMO ("real mode offset") is the value that is ORed to an effective address
> to make the physical address (not added, "offset" is a pretty bad name).
> RML ("real mode limit") is the value that has to be bigger than the effective
> address or you will get an exception.
> RMA ("real mode area") is the name for the range of addresses usable in offset
> real mode.
>
>>> Also, it seems you construct the physical address by masking out bits from
>>> the effective address. Most implementations will trap or machine check if
>>> you address outside of physical address space, instead.
>>
>> Well the only case where I remember to have hit a real RMO case is on the PS3 - that issues a data/instruction storage interrupt when accessing anything > 8MB in real mode.
>>
>> So I'd argue this is heavily implementation specific.
>
> It is. So what is the behaviour you want to implement?

The one below.

>
>> Apart from that what I'm trying to cover is that on ppc64 accessing 0xc0000000000000 in real mode gets you 0x0. Is there a better name for this?
>
> (You missed two zeroes).
> In hypervisor real mode, the top few bits are magic. They are used for e.g.
> enabling hypervisor offset real mode.
> In supervisor real mode, those bits are ignored (and all other bits that do
> not correspond to physical address lines may also be ignored).

So which bits exactly are reserved? I couldn't find a reference to that part.

> Maybe you want to call it physical_address_mask or similar?

PAM - doesn't sound bad :).

Alex