From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JpsZB-0000Bh-4v for qemu-devel@nongnu.org; Sat, 26 Apr 2008 18:08:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JpsZ9-00009Z-Ui for qemu-devel@nongnu.org; Sat, 26 Apr 2008 18:08:20 -0400 Received: from [199.232.76.173] (port=34921 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JpsZ9-00009J-QG for qemu-devel@nongnu.org; Sat, 26 Apr 2008 18:08:19 -0400 Received: from ug-out-1314.google.com ([66.249.92.170]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JpsZ9-0006A5-9Z for qemu-devel@nongnu.org; Sat, 26 Apr 2008 18:08:19 -0400 Received: by ug-out-1314.google.com with SMTP id m2so408799uge.4 for ; Sat, 26 Apr 2008 15:08:10 -0700 (PDT) Message-ID: Date: Sun, 27 Apr 2008 00:08:10 +0200 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [4246] RAM usage information in machine definition. In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: 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 On 26/04/2008, Igor Kovalenko wrote: > On Sun, Apr 27, 2008 at 1:32 AM, andrzej zaborowski wrote: > > > > On 26/04/2008, Igor Kovalenko wrote: > > > On Thu, Apr 24, 2008 at 9:59 PM, Andrzej Zaborowski wrote: > > > > Revision: 4246 > > > > http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4246 > > > > Author: balrog > > > > Date: 2008-04-24 17:59:27 +0000 (Thu, 24 Apr 2008) > > > > > > > > Log Message: > > > > ----------- > > > > RAM usage information in machine definition. > > > [...] > > > > Modified: trunk/hw/sun4u.c > > > > =================================================================== > > > > --- trunk/hw/sun4u.c 2008-04-24 17:20:25 UTC (rev 4245) > > > > +++ trunk/hw/sun4u.c 2008-04-24 17:59:27 UTC (rev 4246) > > > > @@ -385,4 +385,5 @@ > > > > "sun4u", > > > > "Sun4u platform", > > > > sun4u_init, > > > > + PROM_SIZE_MAX + VGA_RAM_SIZE, > > > > }; > > > > > > > [...] > > > > Modified: trunk/vl.c > > > > =================================================================== > > > > --- trunk/vl.c 2008-04-24 17:20:25 UTC (rev 4245) > > > > +++ trunk/vl.c 2008-04-24 17:59:27 UTC (rev 4246) > > > > @@ -8277,7 +8277,7 @@ > > > > machine = first_machine; > > > > cpu_model = NULL; > > > > initrd_filename = NULL; > > > > - ram_size = DEFAULT_RAM_SIZE * 1024 * 1024; > > > > + ram_size = -1; > > > > vga_ram_size = VGA_RAM_SIZE; > > > > #ifdef CONFIG_GDBSTUB > > > > use_gdbstub = 0; > > > > @@ -8963,8 +8963,26 @@ > > > > #endif > > > > > > > > /* init the memory */ > > > > - phys_ram_size = ram_size + vga_ram_size + MAX_BIOS_SIZE; > > > > + phys_ram_size = machine->ram_require & ~RAMSIZE_FIXED; > > > > > > > > + if (machine->ram_require & RAMSIZE_FIXED) { > > > > + if (ram_size > 0) { > > > > + if (ram_size < phys_ram_size) { > > > > + fprintf(stderr, "Machine `%s' requires %i bytes of memory\n", > > > > + machine->name, phys_ram_size); > > > > + exit(-1); > > > > + } > > > > + > > > > + phys_ram_size = ram_size; > > > > + } else > > > > + ram_size = phys_ram_size; > > > > + } else { > > > > + if (ram_size < 0) > > > > + ram_size = DEFAULT_RAM_SIZE * 1024 * 1024; > > > > + > > > > + phys_ram_size += ram_size; > > > > + } > > > > + > > > > phys_ram_base = qemu_vmalloc(phys_ram_size); > > > > if (!phys_ram_base) { > > > > fprintf(stderr, "Could not allocate physical memory\n"); > > > > > > > > > > 512K is not enough to load sparc64 openbios ELF image > > > Can we do something to make sure the elf loader is aware of available space? > > > Or just restore old behavior: > > > > The old behaviour shouldn't be changed as far as I can tell - only the > > first PROM_SIZE_MAX bytes of the PROM were mapped to physical memory > > even if it was larger. If that's too little then yes, probably > > PROM_SIZE_MAX was set too low, and yes the elf loader should know how > > much space is available and not load images too big. > > > > > Well, it was defined to 4M before r4246 in sysemu.h, see below. > Seems like for sun4u that was a typo, please apply the patch to > increase PROM_SIZE_MAX for sun4u.c That was MAX_BIOS_SIZE, but still only 512kB of the PROM was visible in the guest. So to restore the exact old behaviour would be to increase the amount in sun4u_machine.ram_require but not touch PROM_SIZE_MAX. I'm not sure what is more correct? Was it not a problem before that part of the openbios ELF was effectively not loaded into guest accessible ram? Regards -- Please do not print this email unless absolutely necessary. Spread environmental awareness.