kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load()
@ 2009-07-09  9:00 Sheng Yang
  2009-07-13 11:42 ` Sheng Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sheng Yang @ 2009-07-09  9:00 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, Sheng Yang

set_cr3() should already cover the TLB flushing.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
 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;
 }
-- 
1.5.4.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load()
  2009-07-09  9:00 [PATCH] KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load() Sheng Yang
@ 2009-07-13 11:42 ` Sheng Yang
  2009-07-13 13:51   ` Marcelo Tosatti
  2009-07-13 12:23 ` Avi Kivity
  2009-07-15 19:04 ` Marcelo Tosatti
  2 siblings, 1 reply; 6+ messages in thread
From: Sheng Yang @ 2009-07-13 11:42 UTC (permalink / raw)
  To: kvm; +Cc: Avi Kivity, Marcelo Tosatti

On Thursday 09 July 2009 17:00:42 Sheng Yang wrote:
> set_cr3() should already cover the TLB flushing.
>
Comments?

-- 
regards
Yang, Sheng

> Signed-off-by: Sheng Yang <sheng@linux.intel.com>
> ---
>  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;
>  }



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load()
  2009-07-09  9:00 [PATCH] KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load() Sheng Yang
  2009-07-13 11:42 ` Sheng Yang
@ 2009-07-13 12:23 ` Avi Kivity
  2009-07-13 13:29   ` Sheng Yang
  2009-07-15 19:04 ` Marcelo Tosatti
  2 siblings, 1 reply; 6+ messages in thread
From: Avi Kivity @ 2009-07-13 12:23 UTC (permalink / raw)
  To: Sheng Yang; +Cc: kvm

On 07/09/2009 12:00 PM, Sheng Yang wrote:
> set_cr3() should already cover the TLB flushing.
>
> Signed-off-by: Sheng Yang<sheng@linux.intel.com>
> ---
>   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?

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load()
  2009-07-13 12:23 ` Avi Kivity
@ 2009-07-13 13:29   ` Sheng Yang
  0 siblings, 0 replies; 6+ messages in thread
From: Sheng Yang @ 2009-07-13 13:29 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm

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<sheng@linux.intel.com>
> > ---
> >   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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load()
  2009-07-13 11:42 ` Sheng Yang
@ 2009-07-13 13:51   ` Marcelo Tosatti
  0 siblings, 0 replies; 6+ messages in thread
From: Marcelo Tosatti @ 2009-07-13 13:51 UTC (permalink / raw)
  To: Sheng Yang; +Cc: kvm, Avi Kivity

On Mon, Jul 13, 2009 at 07:42:56PM +0800, Sheng Yang wrote:
> On Thursday 09 July 2009 17:00:42 Sheng Yang wrote:
> > set_cr3() should already cover the TLB flushing.
> >
> Comments?

Looks good.

> 
> -- 
> regards
> Yang, Sheng
> 
> > Signed-off-by: Sheng Yang <sheng@linux.intel.com>
> > ---
> >  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;
> >  }
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load()
  2009-07-09  9:00 [PATCH] KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load() Sheng Yang
  2009-07-13 11:42 ` Sheng Yang
  2009-07-13 12:23 ` Avi Kivity
@ 2009-07-15 19:04 ` Marcelo Tosatti
  2 siblings, 0 replies; 6+ messages in thread
From: Marcelo Tosatti @ 2009-07-15 19:04 UTC (permalink / raw)
  To: Sheng Yang; +Cc: Avi Kivity, kvm

On Thu, Jul 09, 2009 at 05:00:42PM +0800, Sheng Yang wrote:
> set_cr3() should already cover the TLB flushing.
> 
> Signed-off-by: Sheng Yang <sheng@linux.intel.com>
> ---
>  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;
>  }
> -- 
> 1.5.4.5

Applied, thanks.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-07-15 19:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-09  9:00 [PATCH] KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load() Sheng Yang
2009-07-13 11:42 ` Sheng Yang
2009-07-13 13:51   ` Marcelo Tosatti
2009-07-13 12:23 ` Avi Kivity
2009-07-13 13:29   ` Sheng Yang
2009-07-15 19:04 ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).