Re: [PATCH 4/5] KVM: Add hypercall queue for paravirt_ops implementation

Anthony Liguori
2007-06-18T17:47:25Z

Avi Kivity wrote:
> Avi Kivity wrote:
>>
>>>
>>>> For every vmexit, it does the entire thing, including vmload/vmsave
>>>
>>> I haven't had a lot of luck eliminating vmload/vmsave.
>>>
>>
>> For x86_64, the only issue I see is with TR. Unfortunately, I don't
>> see a way around it.
>>
>
> I think we can avoid vmload (but not vmsave):
>
> 1. Allocate a host gdt entry for kvm's exclusive use.
>
> 2. The first entry into the guest needs vmload as usual. The second
> entry reuses already-loaded registers, except tr, gs.base, and
> kernelgsbase.
>
> 3. To load tr, copy the descriptor into our gdt entry, and execute ltr.
>
> 4. To load gs.base, load the saved value into MSR_KERNELGSBASE, and
> execute swapgs
>
> 5. To load kernelgsbase, use wrmsr()
>
> However, I'm not at all sure it's worth it.

Yeah, that's where I left it too.

Regards,

Anthony Liguori