summaryrefslogtreecommitdiffstats
path: root/virt/kvm/kvm_main.c
diff options
context:
space:
mode:
authorIzik Eidus <ieidus@redhat.com>2009-06-10 18:23:24 +0200
committerAvi Kivity <avi@redhat.com>2009-06-28 13:10:29 +0200
commite244584fe3a5c20deddeca246548ac86dbc6e1d1 (patch)
treea5765ee9610362cefb9a9cdf2a63de11ae73f479 /virt/kvm/kvm_main.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp (diff)
downloadlinux-e244584fe3a5c20deddeca246548ac86dbc6e1d1.tar.xz
linux-e244584fe3a5c20deddeca246548ac86dbc6e1d1.zip
KVM: Fix dirty bit tracking for slots with large pages
When slot is already allocated and being asked to be tracked we need to break the large pages. This code flush the mmu when someone ask a slot to start dirty bit tracking. Cc: stable@kernel.org Signed-off-by: Izik Eidus <ieidus@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'virt/kvm/kvm_main.c')
-rw-r--r--virt/kvm/kvm_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 764554350ed8..013a5b3e9f75 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1194,6 +1194,8 @@ int __kvm_set_memory_region(struct kvm *kvm,
if (!new.dirty_bitmap)
goto out_free;
memset(new.dirty_bitmap, 0, dirty_bytes);
+ if (old.npages)
+ kvm_arch_flush_shadow(kvm);
}
#endif /* not defined CONFIG_S390 */