Explorar o código

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>
Izik Eidus %!s(int64=16) %!d(string=hai) anos
pai
achega
e244584fe3
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      virt/kvm/kvm_main.c

+ 2 - 0
virt/kvm/kvm_main.c

@@ -1194,6 +1194,8 @@ int __kvm_set_memory_region(struct kvm *kvm,
 		if (!new.dirty_bitmap)
 		if (!new.dirty_bitmap)
 			goto out_free;
 			goto out_free;
 		memset(new.dirty_bitmap, 0, dirty_bytes);
 		memset(new.dirty_bitmap, 0, dirty_bytes);
+		if (old.npages)
+			kvm_arch_flush_shadow(kvm);
 	}
 	}
 #endif /* not defined CONFIG_S390 */
 #endif /* not defined CONFIG_S390 */