kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* KVM: x86: emulator_cmpxchg_emulated should mark_page_dirty
@ 2014-02-26  1:44 Marcelo Tosatti
  2014-02-26  1:51 ` Marcelo Tosatti
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2014-02-26  1:44 UTC (permalink / raw)
  To: kvm-devel; +Cc: Paolo Bonzini, Xiao Guangrong


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

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 39c28f09..29db96d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4394,6 +4394,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;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-26  9:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-26  1:44 KVM: x86: emulator_cmpxchg_emulated should mark_page_dirty Marcelo Tosatti
2014-02-26  1:51 ` Marcelo Tosatti
2014-02-26  3:32 ` Xiao Guangrong
2014-02-26  9:11 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).