Re: [PATCH 27/27] KVM: PPC: Add Documentation about PV interface

Alexander Graf
2010-07-09T09:15:28Z

On 09.07.2010, at 11:11, MJ embd wrote:

> On Thu, Jul 1, 2010 at 4:13 PM, Alexander Graf <agraf-l3A5Bk7waGM@public.gmane.org> wrote:
>> We just introduced a new PV interface that screams for documentation. So here
>> it is - a shiny new and awesome text file describing the internal works of
>> the PPC KVM paravirtual interface.
>>
>> Signed-off-by: Alexander Graf <agraf-l3A5Bk7waGM@public.gmane.org>
>>
>> +
>> +
>> +Some instructions require more logic to determine what's going on than a load
>> +or store instruction can deliver. To enable patching of those, we keep some
>> +RAM around where we can live translate instructions to. What happens is the
>> +following:
>> +
>> + 1) copy emulation code to memory
>> + 2) patch that code to fit the emulated instruction
>> + 3) patch that code to return to the original pc + 4
>> + 4) patch the original instruction to branch to the new code
>> +
>> +That way we can inject an arbitrary amount of code as replacement for a single
>> +instruction. This allows us to check for pending interrupts when setting EE=1
>> +for example.
>> +
>
> Which patch does this mapping ? Can you please point to that.

The branch patching is in patch 22/27. For the respective users, see patch 23-26/27.

Alex