aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2010-05-12 22:07:00 -0400
committerAvi Kivity <avi@redhat.com>2010-08-01 03:35:46 -0400
commit6d74229f013ed8e4a00d74cfa7a3fa6a2315c467 (patch)
tree416b2a3f261a90b6bc0d3f19c10b31b5f14963c8 /arch/x86/kvm/mmu.c
parente8ad9a707496c163312bcdd6aa3b90603d45dc9b (diff)
KVM: MMU: remove rmap before clear spte
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>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index bb48b0ca5f8c..5c9d6df0113e 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1813,6 +1813,7 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
1813 if (level > PT_PAGE_TABLE_LEVEL && 1813 if (level > PT_PAGE_TABLE_LEVEL &&
1814 has_wrprotected_page(vcpu->kvm, gfn, level)) { 1814 has_wrprotected_page(vcpu->kvm, gfn, level)) {
1815 ret = 1; 1815 ret = 1;
1816 rmap_remove(vcpu->kvm, sptep);
1816 spte = shadow_trap_nonpresent_pte; 1817 spte = shadow_trap_nonpresent_pte;
1817 goto set_pte; 1818 goto set_pte;
1818 } 1819 }