diff options
author | Hillf Danton <dhillf@gmail.com> | 2010-09-17 20:41:02 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-10-24 04:52:59 -0400 |
commit | cb16a7b3872e9a806f16b1f09b59103fafc7b796 (patch) | |
tree | 255ee31572d138a2d1a54281881483654f02bf56 /arch | |
parent | a182d8737f0bdfb684b3255c8e266e71999e2225 (diff) |
KVM: MMU: fix counting of rmap entries in rmap_add()
It seems that rmap entries are under counted.
Signed-off-by: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/mmu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 3ce56bfe056e..c94c43289f53 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -632,6 +632,7 @@ static int rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn) | |||
632 | desc->sptes[0] = (u64 *)*rmapp; | 632 | desc->sptes[0] = (u64 *)*rmapp; |
633 | desc->sptes[1] = spte; | 633 | desc->sptes[1] = spte; |
634 | *rmapp = (unsigned long)desc | 1; | 634 | *rmapp = (unsigned long)desc | 1; |
635 | ++count; | ||
635 | } else { | 636 | } else { |
636 | rmap_printk("rmap_add: %p %llx many->many\n", spte, *spte); | 637 | rmap_printk("rmap_add: %p %llx many->many\n", spte, *spte); |
637 | desc = (struct kvm_rmap_desc *)(*rmapp & ~1ul); | 638 | desc = (struct kvm_rmap_desc *)(*rmapp & ~1ul); |
@@ -644,7 +645,7 @@ static int rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn) | |||
644 | desc = desc->more; | 645 | desc = desc->more; |
645 | } | 646 | } |
646 | for (i = 0; desc->sptes[i]; ++i) | 647 | for (i = 0; desc->sptes[i]; ++i) |
647 | ; | 648 | ++count; |
648 | desc->sptes[i] = spte; | 649 | desc->sptes[i] = spte; |
649 | } | 650 | } |
650 | return count; | 651 | return count; |