]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
KVM: MMU: remove rmap before clear spte
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Thu, 13 May 2010 02:07:00 +0000 (10:07 +0800)
committerAvi Kivity <avi@redhat.com>
Sun, 1 Aug 2010 07:35:46 +0000 (10:35 +0300)
Remove rmap before clear spte otherwise it will trigger BUG_ON() in
some functions such as rmap_write_protect().

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/mmu.c

index bb48b0ca5f8c0e36667c6afbe9d4820e2ead6f01..5c9d6df0113e1d48588df889b058d4f1f7af753d 100644 (file)
@@ -1813,6 +1813,7 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
                if (level > PT_PAGE_TABLE_LEVEL &&
                    has_wrprotected_page(vcpu->kvm, gfn, level)) {
                        ret = 1;
+                       rmap_remove(vcpu->kvm, sptep);
                        spte = shadow_trap_nonpresent_pte;
                        goto set_pte;
                }