From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber Costa Subject: Re: [Qemu-devel] Re: [PATCH] Make page_find() return 0 for too-large addresses Date: Mon, 15 Sep 2008 10:08:24 -0300 Message-ID: <20080915130824.GA6066@poweredge.glommer> References: <20080912185856.GM3982@blackpad> <48CAC809.5000901@codemonkey.ws> <20080912201406.GA10147@blackpad> <20080912204404.GB10147@blackpad> <48CADEC2.3060204@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Eduardo Habkost , qemu-devel@nongnu.org, kvm@vger.kernel.org, gcosta@redhat.com To: Anthony Liguori Return-path: Received: from mx2.redhat.com ([66.187.237.31]:48999 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753282AbYIONJw (ORCPT ); Mon, 15 Sep 2008 09:09:52 -0400 Content-Disposition: inline In-Reply-To: <48CADEC2.3060204@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Sep 12, 2008 at 04:27:30PM -0500, Anthony Liguori wrote: > Eduardo Habkost wrote: >> On Fri, Sep 12, 2008 at 05:14:06PM -0300, Eduardo Habkost wrote: >> >>> On Fri, Sep 12, 2008 at 02:50:33PM -0500, Anthony Liguori wrote: >>> >>>> Eduardo Habkost wrote: >>>> >>>>> On some cases, such as under KVM, tb_invalidate_phys_page_range() >>>>> may be called for large addresses, when qemu is configured to more than >>>>> 4GB of RAM. >>>>> >>>>> On these cases, qemu was crashing because it was using an index too >>>>> large for l1_map[], that supports only 32-bit addresses when compiling >>>>> without CONFIG_USER_ONLY. >>>>> >> >> > > So... are you building with kqemu enabled? If so, > TARGET_PHYS_ADDR_SPACE_BITS will be 32. So I don't think this sort of > work-around is correct. A better solution would be to validate ram_size > against TARGET_PHYS_ADDR_SPACE_BITS. > > To put it another way, if you have kqemu enabled (at build time), you > cannot use > ~4GB of memory for the guest. I can be very wrong here, but page_find() does not seem to limit our ability to run guests if > 4GB, as it is only concerned about the code translation layer. Differently from phys_page_find(), that does manage physical memory, and even presented problems about it in the past. > > Regards, > > Anthony Liguori >