From 6f0437e8de95aebbd9e66af4d074c0d5119d86b7 Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Sun, 26 Apr 2009 18:03:40 +0200 Subject: 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 Signed-off-by: Anthony Liguori --- exec.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'exec.c') diff --git a/exec.c b/exec.c index 2effd04..c649381 100644 --- a/exec.c +++ b/exec.c @@ -2484,6 +2484,9 @@ ram_addr_t qemu_ram_alloc(ram_addr_t size) last_ram_offset += size; + if (kvm_enabled()) + kvm_setup_guest_memory(new_block->host, size); + return new_block->offset; } -- cgit v1.1