[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH] spapr-rtas: reset top 4 bits in parameters addres

From: Alexander Graf
Subject: Re: [Qemu-ppc] [PATCH] spapr-rtas: reset top 4 bits in parameters address
Date: Thu, 5 Sep 2013 11:27:07 +0200

On 05.09.2013, at 09:40, Alexey Kardashevskiy wrote:

> On 09/05/2013 05:08 PM, Alexander Graf wrote:
>> Am 05.09.2013 um 07:58 schrieb Alexey Kardashevskiy <address@hidden>:
>>> On the real hardware, RTAS is called in real mode and therefore
>>> ignores top 4 bits of the address passed in the call.
>> Shouldn't we ignore the upper 4 bits for every memory access in real mode, 
>> not just that one parameter?
> We probably should but I just do not see any easy way of doing this. Yet
> another "Ignore N bits on the top" memory region type? No idea.

Well, it already works for code that runs inside of guest context, because 
there the softmmu code for real mode strips the upper 4 bits.

I basically see 2 ways of fixing this "correctly":

1) Don't access memory through cpu_physical_memory_rw or ldx_phys but instead 
through real mode wrappers that strip the upper 4 bits, similar to how we 
handle virtual memory differently from physical memory

2) Create 15 aliases to system_memory at the upper 4 bits of address space. 
That should at the end of the day give you the same effect

The fix as you're proposing it wouldn't work for indirect memory descriptors. 
Imagine you have an "address" parameter that gives you a pointer to a struct in 
memory that again contains a pointer. You still want that pointer be 
interpreted correctly, no?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]