On Tue, Oct 20, 2009 at 10:14:52PM +0900, Avi Kivity wrote:
> On 10/20/2009 09:37 PM, Marcelo Tosatti wrote:
>> GUEST_CR3 is updated via kvm_set_cr3 whenever CR3 value
>> changes.
>>
>> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
>> index 364263a..325075f 100644
>> --- a/arch/x86/kvm/vmx.c
>> +++ b/arch/x86/kvm/vmx.c
>> @@ -3638,10 +3638,9 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu)
>>   {
>>      struct vcpu_vmx *vmx = to_vmx(vcpu);
>>
>> -    if (enable_ept&&  is_paging(vcpu)) {
>> -            vmcs_writel(GUEST_CR3, vcpu->arch.cr3);
>> +    if (enable_ept&&  is_paging(vcpu))
>>              ept_load_pdptrs(vcpu);
>> -    }
>> +
>>      /* Record the guest's net vcpu time for enforced NMI injections. */
>>      if (unlikely(!cpu_has_virtual_nmis()&&  vmx->soft_vnmi_blocked))
>>              vmx->entry_time = ktime_get();
>>    
>
> Nice.  Any reason why ept_load_pdptrs() couldn't go the same way?

Its already protected by VCPU_EXREG_PDPTR caching, so it does not buy
much. 

The advantage would symmetry to cr3.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to