KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load()
PATCH 1/1 KVM: Discard unnecessary kvm_mmu_flush_tlb() in kvm_mmu_load()
set_cr3() should already cover the TLB flushing.
--- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/mmu.c +1 -1
@@ -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; }
Signature · 1 line
1.5.4.5
Quoted 2 lines · On Thursday 09 July 2009 17:00:42 Sheng Yang wrote:
set_cr3()should already cover the TLB flushing.
Comments?
Signature · 2 lines
regards Yang, Sheng
Quoted 19 lines
Signed-off-by Sheng Yang <[email protected]>--- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kvm/mmu.c +1
-1@@ -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; }
Quoted 4 lines · Sheng Yang
Quoted 2 lines · On Thursday 09 July 2009 17:00:42 Sheng Yang wrote:
set_cr3()should already cover the TLB flushing.Comments?
Looks good.
Quoted 25 lines
Signature · 3 lines
-- regards Yang, ShengQuoted 19 lines
Signed-off-by Sheng Yang <[email protected]>--- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kvm/mmu.c +1
-1@@ -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; }
Quoted 13 lines · Sheng Yang
set_cr3()should already cover the TLB flushing.Signed-off-by Sheng Yang<[email protected]>--- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kvm/mmu.c +0
-0
arch/x86/kvm/mmu.c int kvm_mmu_load(struct kvm_vcpu *vcpu) · line 2356
Quoted 9 lines
arch/x86/kvm/mmu.c +1
-1@@ -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?
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 8 lines · On Monday 13 July 2009 20:23:58 Avi Kivity wrote:
Quoted 7 lines · Sheng Yang
set_cr3()should already cover the TLB flushing.Signed-off-by Sheng Yang<[email protected]>--- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 16 lines
Quoted 5 lines
arch/x86/kvm/mmu.c +0
-0arch/x86/kvm/mmu.c int kvm_mmu_load(struct kvm_vcpu *vcpu) · line 2356
Quoted 9 lines
arch/x86/kvm/mmu.c +1
-1@@ -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.
Signature · 2 lines
regards Yang, Sheng
Marcelo Tosatti
AppliedQuoted 23 lines · Sheng Yang
set_cr3()should already cover the TLB flushing.Signed-off-by Sheng Yang <[email protected]>--- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kvm/mmu.c +1
-1@@ -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; }Signature · 1 line
1.5.4.5
Applied, thanks.