aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2010-08-28 07:25:09 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:51:49 -0400
commit8e0e8afa82018a3c751ea474eb47dfc65f00f4c3 (patch)
tree84a86a5c9704f14b8afaa4b65fed4a276f853f65 /arch/x86/kvm/mmu.c
parent365fb3fdf6769d3553999d8eb6cc2a8c56c747c1 (diff)
KVM: MMU: remove count_rmaps()
Nothing is checked in count_rmaps(), so remove it Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 0d91f60af1a8..0bff4d54817e 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3606,43 +3606,6 @@ static void audit_mappings(struct kvm_vcpu *vcpu)
3606 2); 3606 2);
3607} 3607}
3608 3608
3609static int count_rmaps(struct kvm_vcpu *vcpu)
3610{
3611 struct kvm *kvm = vcpu->kvm;
3612 struct kvm_memslots *slots;
3613 int nmaps = 0;
3614 int i, j, k, idx;
3615
3616 idx = srcu_read_lock(&kvm->srcu);
3617 slots = kvm_memslots(kvm);
3618 for (i = 0; i < KVM_MEMORY_SLOTS; ++i) {
3619 struct kvm_memory_slot *m = &slots->memslots[i];
3620 struct kvm_rmap_desc *d;
3621
3622 for (j = 0; j < m->npages; ++j) {
3623 unsigned long *rmapp = &m->rmap[j];
3624
3625 if (!*rmapp)
3626 continue;
3627 if (!(*rmapp & 1)) {
3628 ++nmaps;
3629 continue;
3630 }
3631 d = (struct kvm_rmap_desc *)(*rmapp & ~1ul);
3632 while (d) {
3633 for (k = 0; k < RMAP_EXT; ++k)
3634 if (d->sptes[k])
3635 ++nmaps;
3636 else
3637 break;
3638 d = d->more;
3639 }
3640 }
3641 }
3642 srcu_read_unlock(&kvm->srcu, idx);
3643 return nmaps;
3644}
3645
3646void inspect_spte_has_rmap(struct kvm *kvm, u64 *sptep) 3609void inspect_spte_has_rmap(struct kvm *kvm, u64 *sptep)
3647{ 3610{
3648 unsigned long *rmapp; 3611 unsigned long *rmapp;
@@ -3704,7 +3667,6 @@ static void check_mappings_rmap(struct kvm_vcpu *vcpu)
3704static void audit_rmap(struct kvm_vcpu *vcpu) 3667static void audit_rmap(struct kvm_vcpu *vcpu)
3705{ 3668{
3706 check_mappings_rmap(vcpu); 3669 check_mappings_rmap(vcpu);
3707 count_rmaps(vcpu);
3708} 3670}
3709 3671
3710static void audit_write_protection(struct kvm_vcpu *vcpu) 3672static void audit_write_protection(struct kvm_vcpu *vcpu)