aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@web.de>2009-04-26 18:03:40 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-05-01 10:11:02 -0500
commit57ba0792ca430557ec89aa3daeceb42034161706 (patch)
treeada30ecaa40ef35e868dd3efec77cd3a061aa9c5 /exec.c
parenta2daabc49a94098b12b499b8b82c48abb0b7a66a (diff)
kvm: Avoid COW if KVM MMU is asynchronous
Avi Kivity wrote: > Suggest wrapping in a function and hiding it deep inside kvm-all.c. > Done in v2: ----------> If the KVM MMU is asynchronous (kernel does not support MMU_NOTIFIER), we have to avoid COW for the guest memory. Otherwise we risk serious breakage when guest pages change there physical locations due to COW after fork. Seen when forking smbd during runtime via -smb. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 37468399fc..61a55325ef 100644
--- a/exec.c
+++ b/exec.c
@@ -2386,6 +2386,10 @@ ram_addr_t qemu_ram_alloc(ram_addr_t size)
}
addr = phys_ram_alloc_offset;
phys_ram_alloc_offset = TARGET_PAGE_ALIGN(phys_ram_alloc_offset + size);
+
+ if (kvm_enabled())
+ kvm_setup_guest_memory(phys_ram_base + addr, size);
+
return addr;
}