* KVM: MMU: fix largepage shadow accounting with oos
@ 2008-09-25 18:23 Marcelo Tosatti
2008-09-27 10:35 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Marcelo Tosatti @ 2008-09-25 18:23 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel
There's no need to increase the largepage shadow count when syncing
since there's no count decrement on unsync, only on destruction.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Index: kvm/arch/x86/kvm/mmu.c
===================================================================
--- kvm.orig/arch/x86/kvm/mmu.c
+++ kvm/arch/x86/kvm/mmu.c
@@ -661,8 +661,6 @@ static void rmap_write_protect(struct kv
if (write_protected)
kvm_flush_remote_tlbs(kvm);
-
- account_shadowed(kvm, gfn);
}
static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp)
@@ -1130,8 +1128,10 @@ static struct kvm_mmu_page *kvm_mmu_get_
sp->gfn = gfn;
sp->role = role;
hlist_add_head(&sp->hash_link, bucket);
- if (!metaphysical)
+ if (!metaphysical) {
rmap_write_protect(vcpu->kvm, gfn);
+ account_shadowed(vcpu->kvm, gfn);
+ }
if (shadow_trap_nonpresent_pte != shadow_notrap_nonpresent_pte)
vcpu->arch.mmu.prefetch_page(vcpu, sp);
else
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-27 10:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-25 18:23 KVM: MMU: fix largepage shadow accounting with oos Marcelo Tosatti
2008-09-27 10:35 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).