aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2010-04-27 23:55:06 -0400
committerAvi Kivity <avi@redhat.com>2010-05-19 04:36:27 -0400
commit5e1b3ddbf220d2256a6a0d676a219ed76b8048d0 (patch)
tree0aa62f6ad60ce32de6b738af1f2cec3dd01567ad /arch/x86/kvm/mmu.c
parent85f2067c3192212bce3bd2e1d6ad10153d6f2a4e (diff)
KVM: MMU: move unsync/sync tracpoints to proper place
Move unsync/sync tracepoints to the proper place, it's good for us to obtain unsync page live time Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 18d2f584945b..51eb6d6abd86 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1189,6 +1189,7 @@ static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm *kvm, gfn_t gfn)
1189static void kvm_unlink_unsync_page(struct kvm *kvm, struct kvm_mmu_page *sp) 1189static void kvm_unlink_unsync_page(struct kvm *kvm, struct kvm_mmu_page *sp)
1190{ 1190{
1191 WARN_ON(!sp->unsync); 1191 WARN_ON(!sp->unsync);
1192 trace_kvm_mmu_sync_page(sp);
1192 sp->unsync = 0; 1193 sp->unsync = 0;
1193 --kvm->stat.mmu_unsync; 1194 --kvm->stat.mmu_unsync;
1194} 1195}
@@ -1202,7 +1203,6 @@ static int kvm_sync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
1202 return 1; 1203 return 1;
1203 } 1204 }
1204 1205
1205 trace_kvm_mmu_sync_page(sp);
1206 if (rmap_write_protect(vcpu->kvm, sp->gfn)) 1206 if (rmap_write_protect(vcpu->kvm, sp->gfn))
1207 kvm_flush_remote_tlbs(vcpu->kvm); 1207 kvm_flush_remote_tlbs(vcpu->kvm);
1208 kvm_unlink_unsync_page(vcpu->kvm, sp); 1208 kvm_unlink_unsync_page(vcpu->kvm, sp);
@@ -1730,7 +1730,6 @@ static int kvm_unsync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
1730 struct kvm_mmu_page *s; 1730 struct kvm_mmu_page *s;
1731 struct hlist_node *node, *n; 1731 struct hlist_node *node, *n;
1732 1732
1733 trace_kvm_mmu_unsync_page(sp);
1734 index = kvm_page_table_hashfn(sp->gfn); 1733 index = kvm_page_table_hashfn(sp->gfn);
1735 bucket = &vcpu->kvm->arch.mmu_page_hash[index]; 1734 bucket = &vcpu->kvm->arch.mmu_page_hash[index];
1736 /* don't unsync if pagetable is shadowed with multiple roles */ 1735 /* don't unsync if pagetable is shadowed with multiple roles */
@@ -1740,6 +1739,7 @@ static int kvm_unsync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
1740 if (s->role.word != sp->role.word) 1739 if (s->role.word != sp->role.word)
1741 return 1; 1740 return 1;
1742 } 1741 }
1742 trace_kvm_mmu_unsync_page(sp);
1743 ++vcpu->kvm->stat.mmu_unsync; 1743 ++vcpu->kvm->stat.mmu_unsync;
1744 sp->unsync = 1; 1744 sp->unsync = 1;
1745 1745