From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] Permit -mem-path without sync mmu Date: Fri, 5 Aug 2011 12:30:53 -0300 Message-ID: <20110805153053.GA15083@amt.cnet> References: <1312516970-26606-1-git-send-email-david@gibson.dropbear.id.au> <4E3B8ACA.7080104@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Gibson , qemu-devel@nongnu.org, agraf@suse.de, Avi Kivity , kvm To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53797 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754384Ab1HEPbO (ORCPT ); Fri, 5 Aug 2011 11:31:14 -0400 Content-Disposition: inline In-Reply-To: <4E3B8ACA.7080104@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Aug 05, 2011 at 08:16:42AM +0200, Jan Kiszka wrote: > On 2011-08-05 06:02, David Gibson wrote: > > At present, an explicit test disallows use of -mem-path when kvm is enabled > > but KVM_CAP_SYNC_MMU is not set. In particular, this prevents the user > > from using hugetlbfs to back the guest memory. > > > > I can see no reason for this check, and when I asked about it previously, > > the only theory offered was that this was a limitation of the very early > > days of kvm which only happened to match the SYNC_MMU flag by accident. > > > > This patch, therefore, removes the check. This is of particular use to > > us on POWER, where we haven't yet implement SYNC_MMU, but where backing > > the guest with hugepages is possible, and in fact mandatory (for now). > > > > Signed-off-by: David Gibson > > --- > > exec.c | 5 ----- > > 1 files changed, 0 insertions(+), 5 deletions(-) > > > > diff --git a/exec.c b/exec.c > > index 476b507..041637c 100644 > > --- a/exec.c > > +++ b/exec.c > > @@ -2818,11 +2818,6 @@ static void *file_ram_alloc(RAMBlock *block, > > return NULL; > > } > > > > - if (kvm_enabled() && !kvm_has_sync_mmu()) { > > - fprintf(stderr, "host lacks kvm mmu notifiers, -mem-path unsupported\n"); > > - return NULL; > > - } > > - > > if (asprintf(&filename, "%s/qemu_back_mem.XXXXXX", path) == -1) { > > return NULL; > > } > > This is nothing trivial, see ce9a92411d in qemu-kvm or > http://thread.gmane.org/gmane.comp.emulators.kvm.devel/27380. And it > should rather target uq/master. CCing Avi, Marcelo, and the kvm list. > > Jan Yes, the check cannot be removed because there is the possibility of corruption using hugepages without mmu notifiers (described in the archived message above). Why are mmu notifiers not implemented for PPC again? From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpMMj-0005Uj-Jk for qemu-devel@nongnu.org; Fri, 05 Aug 2011 11:31:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QpMMh-0000YH-TO for qemu-devel@nongnu.org; Fri, 05 Aug 2011 11:31:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QpMMh-0000Y3-C8 for qemu-devel@nongnu.org; Fri, 05 Aug 2011 11:31:11 -0400 Date: Fri, 5 Aug 2011 12:30:53 -0300 From: Marcelo Tosatti Message-ID: <20110805153053.GA15083@amt.cnet> References: <1312516970-26606-1-git-send-email-david@gibson.dropbear.id.au> <4E3B8ACA.7080104@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E3B8ACA.7080104@web.de> Subject: Re: [Qemu-devel] [PATCH] Permit -mem-path without sync mmu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: agraf@suse.de, Avi Kivity , qemu-devel@nongnu.org, kvm , David Gibson On Fri, Aug 05, 2011 at 08:16:42AM +0200, Jan Kiszka wrote: > On 2011-08-05 06:02, David Gibson wrote: > > At present, an explicit test disallows use of -mem-path when kvm is enabled > > but KVM_CAP_SYNC_MMU is not set. In particular, this prevents the user > > from using hugetlbfs to back the guest memory. > > > > I can see no reason for this check, and when I asked about it previously, > > the only theory offered was that this was a limitation of the very early > > days of kvm which only happened to match the SYNC_MMU flag by accident. > > > > This patch, therefore, removes the check. This is of particular use to > > us on POWER, where we haven't yet implement SYNC_MMU, but where backing > > the guest with hugepages is possible, and in fact mandatory (for now). > > > > Signed-off-by: David Gibson > > --- > > exec.c | 5 ----- > > 1 files changed, 0 insertions(+), 5 deletions(-) > > > > diff --git a/exec.c b/exec.c > > index 476b507..041637c 100644 > > --- a/exec.c > > +++ b/exec.c > > @@ -2818,11 +2818,6 @@ static void *file_ram_alloc(RAMBlock *block, > > return NULL; > > } > > > > - if (kvm_enabled() && !kvm_has_sync_mmu()) { > > - fprintf(stderr, "host lacks kvm mmu notifiers, -mem-path unsupported\n"); > > - return NULL; > > - } > > - > > if (asprintf(&filename, "%s/qemu_back_mem.XXXXXX", path) == -1) { > > return NULL; > > } > > This is nothing trivial, see ce9a92411d in qemu-kvm or > http://thread.gmane.org/gmane.comp.emulators.kvm.devel/27380. And it > should rather target uq/master. CCing Avi, Marcelo, and the kvm list. > > Jan Yes, the check cannot be removed because there is the possibility of corruption using hugepages without mmu notifiers (described in the archived message above). Why are mmu notifiers not implemented for PPC again?