提交 ff990d59 编写于 作者: U Uri Lublin 提交者: Avi Kivity

KVM: Remove write access permissions when dirty-page-logging is enabled

Enabling dirty page logging is done using KVM_SET_MEMORY_REGION ioctl.
If the memory region already exists, we need to remove write accesses,
so writes will be caught, and dirty pages will be logged.
Signed-off-by: NUri Lublin <uril@qumranet.com>
Signed-off-by: NAvi Kivity <avi@qumranet.com>
上级 02b27c1f
......@@ -748,6 +748,8 @@ static int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
vcpu = vcpu_load_slot(kvm, i);
if (!vcpu)
continue;
if (new.flags & KVM_MEM_LOG_DIRTY_PAGES)
do_remove_write_access(vcpu, mem->slot);
kvm_mmu_reset_context(vcpu);
vcpu_put(vcpu);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册