Skip to contentSkip to conversation

live migration support for initial write protect of VM

PATCH Superseded Mario Smarduch 1 participant 1 message Apr 17, 2014

Subsystems (2)

v1 of 11 Superseded Latest is v11 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/5 live migration support for initial write protect of VM

Add support for initial write protection of guest VM, to later manage dirty pages. Reduced TLB flushing to one flush after memory region is write protected. This is based on Erics patch, which applied cleanly. The only patch I found in the archives was the memory region delete, but still in arm.c.

---
 arch/arm/include/asm/kvm_host.h |    1 +
 arch/arm/kvm/arm.c              |    4 ++
 arch/arm/kvm/mmu.c              |  125 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 130 insertions(+)
arch/arm/include/asm/kvm_host.h +1 -0
index 315e3f3..7ac1fdc 100644
@@ -229,5 +229,6 @@ u64 kvm_arm_timer_get_reg(struct kvm_vcpu *, u64 regid);
 int kvm_arm_timer_set_reg(struct kvm_vcpu *, u64 regid, u64 value);
 
 void kvm_tlb_flush_vm(struct kvm *kvm);
+void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot);
 
 #endif /* __ARM_KVM_HOST_H__ */
arch/arm/kvm/arm.c +4 -0
index 9a4bc10..7714cc6 100644
@@ -249,6 +249,10 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
 		unmap_stage2_range(kvm, gpa, size);
 		spin_unlock(&kvm->mmu_lock);
 	}
+
+	/* Request has been issued to migrate the guest, 1st write protect VM */
+	if ((change != KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES))
+		kvm_mmu_slot_remove_write_access(kvm, mem->slot);
 }
 
 void kvm_arch_flush_shadow_all(struct kvm *kvm)
arch/arm/kvm/mmu.c +125 -0

131 lines not on this page · raw message

Signature · 1 line
1.7.9.5