aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm_main.c
diff options
context:
space:
mode:
authorUri Lublin <uril@qumranet.com>2007-02-22 10:37:32 -0500
committerAvi Kivity <avi@qumranet.com>2007-03-04 04:12:43 -0500
commitff990d5952712c2e163b355946c39278da8407a8 (patch)
tree73766d7c8435ded99d8a107b4471a8020164d800 /drivers/kvm/kvm_main.c
parent02b27c1f802bfb60cc2cb5b763dde1b6b3479a7e (diff)
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: Uri Lublin <uril@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r--drivers/kvm/kvm_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index be7694db285d..e48b4d7a350e 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -748,6 +748,8 @@ raced:
748 vcpu = vcpu_load_slot(kvm, i); 748 vcpu = vcpu_load_slot(kvm, i);
749 if (!vcpu) 749 if (!vcpu)
750 continue; 750 continue;
751 if (new.flags & KVM_MEM_LOG_DIRTY_PAGES)
752 do_remove_write_access(vcpu, mem->slot);
751 kvm_mmu_reset_context(vcpu); 753 kvm_mmu_reset_context(vcpu);
752 vcpu_put(vcpu); 754 vcpu_put(vcpu);
753 } 755 }