From: Izik Eidus Date: Wed, 10 Jun 2009 16:23:24 +0000 (+0300) Subject: KVM: Fix dirty bit tracking for slots with large pages X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e244584fe3a5c20deddeca246548ac86dbc6e1d1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Avi Kivity --- 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 */