Skip to content

Commit

Permalink
KVM: MMU: fix counting of rmap entries in rmap_add()
Browse files Browse the repository at this point in the history
It seems that rmap entries are under counted.

Signed-off-by: Hillf Danton <[email protected]>
Signed-off-by: Marcelo Tosatti <[email protected]>
  • Loading branch information
Hillf Danton authored and avikivity committed Oct 24, 2010
1 parent a182d87 commit cb16a7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ static int rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn)
desc->sptes[0] = (u64 *)*rmapp;
desc->sptes[1] = spte;
*rmapp = (unsigned long)desc | 1;
++count;
} else {
rmap_printk("rmap_add: %p %llx many->many\n", spte, *spte);
desc = (struct kvm_rmap_desc *)(*rmapp & ~1ul);
Expand All @@ -644,7 +645,7 @@ static int rmap_add(struct kvm_vcpu *vcpu, u64 *spte, gfn_t gfn)
desc = desc->more;
}
for (i = 0; desc->sptes[i]; ++i)
;
++count;
desc->sptes[i] = spte;
}
return count;
Expand Down

0 comments on commit cb16a7b

Please sign in to comment.