public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: mmu: fix counting of rmap entries in rmap_add()
@ 2010-09-18  0:41 Hillf Danton
  2010-09-20 23:13 ` Marcelo Tosatti
  0 siblings, 1 reply; 2+ messages in thread
From: Hillf Danton @ 2010-09-18  0:41 UTC (permalink / raw)
  To: Yaniv Kamay, Avi Kivity, kvm

It seems that rmap entries are under counted.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---

--- o/linux-2.6.36-rc1/arch/x86/kvm/mmu.c	2010-08-16 08:41:38.000000000 +0800
+++ m/linux-2.6.36-rc1/arch/x86/kvm/mmu.c	2010-09-18 07:51:44.000000000 +0800
@@ -591,6 +591,7 @@ static int rmap_add(struct kvm_vcpu *vcp
 		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);
@@ -603,7 +604,7 @@ static int rmap_add(struct kvm_vcpu *vcp
 			desc = desc->more;
 		}
 		for (i = 0; desc->sptes[i]; ++i)
-			;
+			++count;
 		desc->sptes[i] = spte;
 	}
 	return count;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: x86: mmu: fix counting of rmap entries in rmap_add()
  2010-09-18  0:41 [PATCH] KVM: x86: mmu: fix counting of rmap entries in rmap_add() Hillf Danton
@ 2010-09-20 23:13 ` Marcelo Tosatti
  0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2010-09-20 23:13 UTC (permalink / raw)
  To: Hillf Danton; +Cc: Yaniv Kamay, Avi Kivity, kvm

On Sat, Sep 18, 2010 at 08:41:02AM +0800, Hillf Danton wrote:
> It seems that rmap entries are under counted.
> 
> Signed-off-by: Hillf Danton <dhillf@gmail.com>
> ---

Applied, thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-21 15:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-18  0:41 [PATCH] KVM: x86: mmu: fix counting of rmap entries in rmap_add() Hillf Danton
2010-09-20 23:13 ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox