Skip to contentSkip to conversation

KVM: x86: emulator_cmpxchg_emulated should mark_page_dirty

PATCH Applied Marcelo Tosatti 3 participants 4 messages Feb 26, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

arch/x86/kvm/x86.c +1 -0
index 39c28f09..29db96d 100644
@@ -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;
#1 lore raw
Quoted 3 lines · Marcelo Tosatti

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

s/updated/update/

Quoted 19 lines
arch/x86/kvm/x86.c +1 -1
index 39c28f09..29db96d 100644
@@ -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;
--

To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer Applied
#3 lore raw
In reply to Marcelo Tosatti

Il 26/02/2014 02:44, Marcelo Tosatti ha scritto:

Quoted 19 lines

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

arch/x86/kvm/x86.c +1 -1
index 39c28f09..29db96d 100644
@@ -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;
--
Quoted 4 lines

To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied to kvm/queue, thanks.

Paolo