From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: KVM: VMX: remove GUEST_CR3 write from vmx_vcpu_run Date: Tue, 20 Oct 2009 22:14:52 +0900 Message-ID: <4ADDB7CC.8040808@redhat.com> References: <20091020123720.GA5679@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21322 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751832AbZJTNOw (ORCPT ); Tue, 20 Oct 2009 09:14:52 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9KDEvAB028663 for ; Tue, 20 Oct 2009 09:14:57 -0400 In-Reply-To: <20091020123720.GA5679@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: 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? -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.