From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH] KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load() Date: Mon, 13 Jul 2009 21:29:16 +0800 Message-ID: <200907132129.16579.sheng@linux.intel.com> References: <1247130042-32290-1-git-send-email-sheng@linux.intel.com> <4A5B275E.5070009@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mga05.intel.com ([192.55.52.89]:39886 "EHLO fmsmga101.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754098AbZGMN3S (ORCPT ); Mon, 13 Jul 2009 09:29:18 -0400 In-Reply-To: <4A5B275E.5070009@redhat.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Monday 13 July 2009 20:23:58 Avi Kivity wrote: > On 07/09/2009 12:00 PM, Sheng Yang wrote: > > set_cr3() should already cover the TLB flushing. > > > > Signed-off-by: Sheng Yang > > --- > > arch/x86/kvm/mmu.c | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c > > index 231d880..501c11e 100644 > > --- a/arch/x86/kvm/mmu.c > > +++ b/arch/x86/kvm/mmu.c > > @@ -2349,8 +2349,8 @@ int kvm_mmu_load(struct kvm_vcpu *vcpu) > > spin_unlock(&vcpu->kvm->mmu_lock); > > if (r) > > goto out; > > + /* set_cr3() should ensure TLB has been flushed */ > > kvm_x86_ops->set_cr3(vcpu, vcpu->arch.mmu.root_hpa); > > - kvm_mmu_flush_tlb(vcpu); > > out: > > return r; > > } > > Maybe we should drop the flushes in vmx/svm instead? That's what I unsure about... mmu_load() with flushes sounds reasonable, set_cr3() with flushes sounds a little more reasonable to me because I think set_cr3() may shouldn't depends on caller to flush, which seems more direct. -- regards Yang, Sheng