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 @@ 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); }