From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KeGBk-00011Q-F7 for qemu-devel@nongnu.org; Fri, 12 Sep 2008 17:28:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KeGBi-0000zq-Pk for qemu-devel@nongnu.org; Fri, 12 Sep 2008 17:28:24 -0400 Received: from [199.232.76.173] (port=56479 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeGBi-0000zf-J2 for qemu-devel@nongnu.org; Fri, 12 Sep 2008 17:28:22 -0400 Received: from mail-gx0-f19.google.com ([209.85.217.19]:61587) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KeGBi-000673-9n for qemu-devel@nongnu.org; Fri, 12 Sep 2008 17:28:22 -0400 Received: by gxk12 with SMTP id 12so20051855gxk.10 for ; Fri, 12 Sep 2008 14:28:21 -0700 (PDT) Message-ID: <48CADEC2.3060204@codemonkey.ws> Date: Fri, 12 Sep 2008 16:27:30 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] Make page_find() return 0 for too-large addresses References: <20080912185856.GM3982@blackpad> <48CAC809.5000901@codemonkey.ws> <20080912201406.GA10147@blackpad> <20080912204404.GB10147@blackpad> In-Reply-To: <20080912204404.GB10147@blackpad> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, gcosta@redhat.com 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. Regards, Anthony Liguori