From ce9a92411db074b081cced02f164735bcd6bbb41 Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Tue, 13 Jan 2009 18:36:17 -0200 Subject: [PATCH] Make --mem-path memory allocation depend on mmu notifiers Without mmu notifiers usage of hugepages to back guest memory can cause memory corruption. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity --- vl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vl.c b/vl.c index dd26f079a0..9557a06485 100644 --- a/vl.c +++ b/vl.c @@ -4708,6 +4708,11 @@ static void *alloc_mem_area(size_t memory, unsigned long *len, const char *path) void *area; int fd; + if (!kvm_has_sync_mmu()) { + fprintf(stderr, "host lacks mmu notifiers, disabling --mem-path\n"); + return NULL; + } + if (asprintf(&filename, "%s/kvm.XXXXXX", path) == -1) return NULL; -- 2.11.4.GIT