From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: KVM: VMX: remove GUEST_CR3 write from vmx_vcpu_run Date: Thu, 22 Oct 2009 15:35:19 +0800 Message-ID: <200910221535.20614.sheng@linux.intel.com> References: <20091020123720.GA5679@amt.cnet> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Avi Kivity To: kvm@vger.kernel.org Return-path: Received: from mga09.intel.com ([134.134.136.24]:47591 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751687AbZJVHrI (ORCPT ); Thu, 22 Oct 2009 03:47:08 -0400 In-Reply-To: <20091020123720.GA5679@amt.cnet> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Tuesday 20 October 2009 20:37:20 Marcelo Tosatti wrote: > GUEST_CR3 is updated via kvm_set_cr3 whenever CR3 value > changes. The description is not that accuracy... If CR3 value change in guest when EPT enabled, no VM Exit would happen, then no kvm_set_cr3... -- regards Yang, Sheng > > Signed-off-by: Marcelo Tosatti > > 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(); > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html