KVM: Fix dirty bit tracking for slots with large pages
authorIzik Eidus <ieidus@redhat.com>
Wed, 10 Jun 2009 16:23:24 +0000 (19:23 +0300)
committerAvi Kivity <avi@redhat.com>
Sun, 28 Jun 2009 11:10:29 +0000 (14:10 +0300)
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>
virt/kvm/kvm_main.c

index 764554350ed86f41b26f45eb840ad02138a55081..013a5b3e9f75cd473832cb63d81723198e23063d 100644 (file)
@@ -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 */