KVM: Allocate guest memory as MAP_PRIVATE, not MAP_SHARED
authorAvi Kivity <avi@qumranet.com>
Tue, 26 Aug 2008 14:22:47 +0000 (17:22 +0300)
committerAvi Kivity <avi@qumranet.com>
Wed, 15 Oct 2008 08:15:23 +0000 (10:15 +0200)
There is no reason to share internal memory slots with fork()ed instances.

Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/x86.c

index bfc7c332c5d70caf1c1bd7a5b33199b6baf64273..675d010995a266273ece8db88014e278abc7dd39 100644 (file)
@@ -4296,7 +4296,7 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
                        userspace_addr = do_mmap(NULL, 0,
                                                 npages * PAGE_SIZE,
                                                 PROT_READ | PROT_WRITE,
-                                                MAP_SHARED | MAP_ANONYMOUS,
+                                                MAP_PRIVATE | MAP_ANONYMOUS,
                                                 0);
                        up_write(&current->mm->mmap_sem);