Re: paravirtualization structure

Avi Kivity
2007-02-20T07:14:21Z

Omar Khan wrote:
> Dor Laor <dor.laor@...> writes:
>
>
>
>> Theoretically speaking the answer is yes, vmcall is a special
>> instruction that it one and only purpose is the exit from the guest.
>> While mov cr3 instruction might be bound to other actions of the
>> processor and might have more effects on the pipeline, this harder to
>> optimize for vmexit purposes.
>>
>>
>
> I guess what is confusing me is that the vmcall causes an vmexit in VMX non-root
> mode (the one in which a paravirtualized guest is operating), but Avi says that
> a hypercal (made using a vmcall) 'avoids' a vmentry/vmexit and Ingo comments in
> his patch that :
>
> "This utilizes the cr3 filter capability of the hardware - if this works out
> then no VM exit happens"
>
> NO VM-exits happen. hmmmm... maybe I need to go over the intel manuals more
> thoroughly, however any hints will be most welcomed.
>

Using the cr3 filter does not involve a hypercall. Instead, it allows
the guest to context switch without trapping on the mov %cr3
instruction, by providing a set of pre-prepared cr3s.

--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.