Skip to content

Commit

Permalink
KVM: x86: emulator_cmpxchg_emulated should mark_page_dirty
Browse files Browse the repository at this point in the history
emulator_cmpxchg_emulated writes to guest memory, therefore it should
update the dirty bitmap accordingly.

Signed-off-by: Marcelo Tosatti <[email protected]>
Reviewed-by: Xiao Guangrong <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
matosatti authored and bonzini committed Feb 26, 2014
1 parent 390bd52 commit d371401
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -4399,6 +4399,7 @@ static int emulator_cmpxchg_emulated(struct x86_emulate_ctxt *ctxt,
if (!exchanged)
return X86EMUL_CMPXCHG_FAILED;

mark_page_dirty(vcpu->kvm, gpa >> PAGE_SHIFT);
kvm_mmu_pte_write(vcpu, gpa, new, bytes);

return X86EMUL_CONTINUE;
Expand Down

0 comments on commit d371401

Please sign in to comment.