Browse Source

KVM: x86: emulator_cmpxchg_emulated should mark_page_dirty

emulator_cmpxchg_emulated writes to guest memory, therefore it should
update the dirty bitmap accordingly.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Marcelo Tosatti 11 years ago
parent
commit
d3714010c3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      arch/x86/kvm/x86.c

+ 1 - 0
arch/x86/kvm/x86.c

@@ -4399,6 +4399,7 @@ static int emulator_cmpxchg_emulated(struct x86_emulate_ctxt *ctxt,
 	if (!exchanged)
 	if (!exchanged)
 		return X86EMUL_CMPXCHG_FAILED;
 		return X86EMUL_CMPXCHG_FAILED;
 
 
+	mark_page_dirty(vcpu->kvm, gpa >> PAGE_SHIFT);
 	kvm_mmu_pte_write(vcpu, gpa, new, bytes);
 	kvm_mmu_pte_write(vcpu, gpa, new, bytes);
 
 
 	return X86EMUL_CONTINUE;
 	return X86EMUL_CONTINUE;