From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KsICX-0001Xl-8V for qemu-devel@nongnu.org; Tue, 21 Oct 2008 10:27:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KsICV-0001XV-MJ for qemu-devel@nongnu.org; Tue, 21 Oct 2008 10:27:12 -0400 Received: from [199.232.76.173] (port=44069 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsICV-0001XK-Db for qemu-devel@nongnu.org; Tue, 21 Oct 2008 10:27:11 -0400 Received: from yw-out-1718.google.com ([74.125.46.158]:4276) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KsICV-0003bo-3X for qemu-devel@nongnu.org; Tue, 21 Oct 2008 10:27:11 -0400 Received: by yw-out-1718.google.com with SMTP id 6so385790ywa.82 for ; Tue, 21 Oct 2008 07:27:10 -0700 (PDT) Message-ID: <48FDE6BA.4070102@codemonkey.ws> Date: Tue, 21 Oct 2008 09:27:06 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Allocate translation buffer before guest RAM, in case guest RAM is too large on 64 bit hosts References: <20081018210508.GA51078@saturn.kn-bremen.de> In-Reply-To: <20081018210508.GA51078@saturn.kn-bremen.de> 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: qemu-devel@nongnu.org Juergen Lock wrote: > Hi! > > The following patch appears to fix -m >= 1024 on recent FreeBSD/amd64 hosts > (RELENG_7/HEAD) that no longer return high addresses for allocations by > default (which was the original reason for r5331.) As this makes sense > in any case when you pass something like -m 4096 on hosts that allocate > from low addresses by default (there would be no room left for the > translation buffer in the low vm where it needs to be), I patched it like > this instead of conditionalizing the mmap hack from r5331 on the FreeBSD > version. > I fear there is too much magic here. Does FreeBSD not have a flag to mmap from high memory? What is the the original problem? Regards, Anthony Liguori > Index: qemu/vl.c > @@ -9850,15 +9850,15 @@ > phys_ram_size += ram_size; > } > > + /* init the dynamic translator */ > + cpu_exec_init_all(tb_size * 1024 * 1024); > + > phys_ram_base = qemu_vmalloc(phys_ram_size); > if (!phys_ram_base) { > fprintf(stderr, "Could not allocate physical memory\n"); > exit(1); > } > > - /* init the dynamic translator */ > - cpu_exec_init_all(tb_size * 1024 * 1024); > - > bdrv_init(emulate_aio); > > /* we always create the cdrom drive, even if no disk is there */ > > Signed-off-by: Juergen Lock > > >