Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d74229f authored by Xiao Guangrong's avatar Xiao Guangrong Committed by Avi Kivity
Browse files

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: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent e8ad9a70
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
		}