KVM: MMU: do not reuse the obsolete page
authorXiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Fri, 31 May 2013 00:36:26 +0000 (08:36 +0800)
committerGleb Natapov <gleb@redhat.com>
Wed, 5 Jun 2013 09:33:04 +0000 (12:33 +0300)
The obsolete page will be zapped soon, do not reuse it to
reduce future page fault

Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
arch/x86/kvm/mmu.c

index 3fd060af539429a4e68474550cb2480f4d3f98e3..0880b9b425d7f0e0d08bfae52c76369688dca165 100644 (file)
@@ -1875,6 +1875,9 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
                role.quadrant = quadrant;
        }
        for_each_gfn_sp(vcpu->kvm, sp, gfn) {
+               if (is_obsolete_sp(vcpu->kvm, sp))
+                       continue;
+
                if (!need_sync && sp->unsync)
                        need_sync = true;