From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: kvm: make --mem-path memory allocation depend on mmu notifiers Date: Tue, 13 Jan 2009 14:38:33 -0600 Message-ID: <496CFBC9.6040006@codemonkey.ws> References: <20090113203617.GA8671@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Avi Kivity To: Marcelo Tosatti Return-path: Received: from mail-qy0-f11.google.com ([209.85.221.11]:40452 "EHLO mail-qy0-f11.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754285AbZAMUip (ORCPT ); Tue, 13 Jan 2009 15:38:45 -0500 Received: by qyk4 with SMTP id 4so252805qyk.13 for ; Tue, 13 Jan 2009 12:38:44 -0800 (PST) In-Reply-To: <20090113203617.GA8671@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > Without mmu notifiers usage of hugepages to back guest memory can cause > memory corruption. > Really? Why's that? Sorry if I missed a previous discussion of this. Regards, Anthony Liguori > Signed-off-by: Marcelo Tosatti > > > diff --git a/qemu/vl.c b/qemu/vl.c > index d0660ab..49cf066 100644 > --- a/qemu/vl.c > +++ b/qemu/vl.c > @@ -4664,6 +4664,11 @@ 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; > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >