Skip to content

Commit

Permalink
KVM: Remove write access permissions when dirty-page-logging is enabled
Browse files Browse the repository at this point in the history
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: Uri Lublin <uril@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Uri Lublin authored and Avi Kivity committed Mar 4, 2007
1 parent 02b27c1 commit ff990d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ff990d5

Please sign in to comment.