summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorCao jin <caoj.fnst@cn.fujitsu.com>2016-09-12 14:34:56 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2016-09-13 19:09:43 +0200
commitc2cd627ddb13f62557aaf66305edb03cc3d9612d (patch)
tree371e69422977c0c55d704199f10274c87a10562f /exec.c
parenta952c18683bbfa67f6c508c7417001a0bd1b2b97 (diff)
downloadqemu-c2cd627ddb13f62557aaf66305edb03cc3d9612d.tar.gz
kvm-all: drop kvm_setup_guest_memory
kvm_setup_guest_memory only does "madvise to QEMU_MADV_DONTFORK" and is only called by ram_block_add, which actually is duplicate code. Bonus: add simple comment for kvm_has_sync_mmu to make life easier. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com> Message-Id: <1473662096-32598-1-git-send-email-caoj.fnst@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/exec.c b/exec.c
index ce3fb9ec8e..c81d5ab981 100644
--- a/exec.c
+++ b/exec.c
@@ -1621,10 +1621,8 @@ static void ram_block_add(RAMBlock *new_block, Error **errp)
if (new_block->host) {
qemu_ram_setup_dump(new_block->host, new_block->max_length);
qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_HUGEPAGE);
+ /* MADV_DONTFORK is also needed by KVM in absence of synchronous MMU */
qemu_madvise(new_block->host, new_block->max_length, QEMU_MADV_DONTFORK);
- if (kvm_enabled()) {
- kvm_setup_guest_memory(new_block->host, new_block->max_length);
- }
}
}