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

Avi Kivity
2007-06-18T16:00:16Z

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.

--
error compiling committee.c: too many arguments to function