summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2014-02-25 22:44:54 -0300
committerPaolo Bonzini <pbonzini@redhat.com>2014-02-26 10:11:08 +0100
commitd3714010c307d26df251c45be9cd12ab6d41f0c4 (patch)
tree63393c8f90a2df6ddc7435b65410d54fc63b4bf1
parent390bd528ae1c14d0b7f5db8225984f98617b3357 (diff)
downloadop-kernel-dev-d3714010c307d26df251c45be9cd12ab6d41f0c4.zip
op-kernel-dev-d3714010c307d26df251c45be9cd12ab6d41f0c4.tar.gz
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>
-rw-r--r--arch/x86/kvm/x86.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 65300191..4cca458 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -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;
OpenPOWER on IntegriCloud