From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTqdj-0005G2-MZ for qemu-devel@nongnu.org; Thu, 11 Feb 2016 07:46:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTqdi-0004d6-QX for qemu-devel@nongnu.org; Thu, 11 Feb 2016 07:46:31 -0500 Received: from mail-vk0-x22e.google.com ([2607:f8b0:400c:c05::22e]:35684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTqdi-0004ca-Kr for qemu-devel@nongnu.org; Thu, 11 Feb 2016 07:46:30 -0500 Received: by mail-vk0-x22e.google.com with SMTP id e6so35299574vkh.2 for ; Thu, 11 Feb 2016 04:46:30 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 11 Feb 2016 09:46:29 -0300 Message-ID: From: Aurelio Remonda Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Memory on stellaris board List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers On Fri, Feb 5, 2016 at 2:00 PM, Peter Maydell wr= ote: > On 5 February 2016 at 16:55, Aurelio Remonda > wrote: >> Im making something like this: >> >> if (ram_size =3D=3D 0x8000000) /* default value, means whitout -m f= lag */ >> { >> sram_size =3D ((board->dc0 >> 18) + * 1024; >> } >> else if (ram_size >=3D UINT_MAX) /* more than 4GB */ >> sram_size =3D UINT_MAX; >> else >> sram_size =3D ram_size >> >> So in case someone does not use the -m flag i want to be sure the ram is >> calculated like it was before. > > The right way to do this is to set the MachineClass default_ram_size > to what you want your default value to be. Then you should calculate > the dc0 etc values to expose to the guest based on the ram size > (which might be the default or might be user specified). But stellaris board has a hardcoded dc0 value, when you place the -m flag with for example 256M you shouldn't calculate any sram_size from dc0, you just assign that as your ram size. > If the user asks for a value that you can't handle (eg it is too big) > then you should report the problem (via error_report()) and exit. Fair enough. Thank you! --=20 Aurelio Remonda Software Engineer San Lorenzo 47, 3rd Floor, Office 5 C=C3=B3rdoba, Argentina Phone: +54-351-4217888 / 4218211