From af300d11ea285f31cf4fec08204c108552912b2a Mon Sep 17 00:00:00 2001 From: Izik Eidus Date: Wed, 10 Jun 2009 19:23:24 +0300 Subject: [PATCH] KVM: Fix dirty bit tracking for slots with large pages commit e244584fe3a5c20deddeca246548ac86dbc6e1d1 upstream. 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. Signed-off-by: Izik Eidus Signed-off-by: Avi Kivity Signed-off-by: Greg Kroah-Hartman --- virt/kvm/kvm_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 9eaba7572650..148982913805 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -1030,6 +1030,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 */ -- 2.39.5