From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCu68-0004TB-EW for qemu-devel@nongnu.org; Fri, 23 Aug 2013 12:20:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCu63-0007Zn-Dk for qemu-devel@nongnu.org; Fri, 23 Aug 2013 12:20:28 -0400 Received: from cantor2.suse.de ([195.135.220.15]:51578 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCu63-0007ZU-4C for qemu-devel@nongnu.org; Fri, 23 Aug 2013 12:20:23 -0400 Message-ID: <52178BC3.9020704@suse.de> Date: Fri, 23 Aug 2013 18:20:19 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1377269838-13347-1-git-send-email-yongbok.kim@imgtec.com> In-Reply-To: <1377269838-13347-1-git-send-email-yongbok.kim@imgtec.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] hw: fix to display correct memory size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yongbok Kim Cc: critian.cuna@imgtec.com, leon.alrae@imgtec.com, qemu-devel@nongnu.org, aurelien@aurel32.net, agraf@suse.de Am 23.08.2013 16:57, schrieb Yongbok Kim: > A parenthesis placed inappropriately caused displaying > wrong memory size bigger than 4GB. >=20 > Signed-off-by: Yongbok Kim > --- > hw/mips/mips_malta.c | 2 +- > hw/mips/mips_r4k.c | 2 +- > hw/ppc/mac_oldworld.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) Thanks for fixing this even beyond MIPS machines! In theory I would've preferred a patch using the correct format string and dropping the unsigned int cast completely, but our RAM_ADDR_FMT uses hexadecimal format, so: Reviewed-by: Andreas F=E4rber > diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c > index f8d064c..23ac1ca 100644 > --- a/hw/mips/mips_malta.c > +++ b/hw/mips/mips_malta.c > @@ -954,7 +954,7 @@ void mips_malta_init(QEMUMachineInitArgs *args) > if (ram_size > (256 << 20)) { > fprintf(stderr, > "qemu: Too much memory for this machine: %d MB, maximu= m 256 MB\n", > - ((unsigned int)ram_size / (1 << 20))); > + (unsigned int)(ram_size / (1 << 20))); Seeing that in the Malta case your other patch will trivially conflict with this bugfix, would you have time to turn it into a series of three patches, this being the first and adding "Cc: qemu-stable@nongnu.org" to its commit message for inclusion in 1.6.1, then an additional patch replacing fprintf(stderr, "qemu: ...\n", ...) with error_report("...", ...) (note no trailing \n and it will also automatically prefix the right qemu-system-mips* executable name) and finally your 2 GiB patch? Regards, Andreas > exit(1); > } > memory_region_init_ram(ram, NULL, "mips_malta.ram", ram_size); > diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c > index 044f232..e8108ac 100644 > --- a/hw/mips/mips_r4k.c > +++ b/hw/mips/mips_r4k.c > @@ -201,7 +201,7 @@ void mips_r4k_init(QEMUMachineInitArgs *args) > if (ram_size > (256 << 20)) { > fprintf(stderr, > "qemu: Too much memory for this machine: %d MB, maximu= m 256 MB\n", > - ((unsigned int)ram_size / (1 << 20))); > + (unsigned int)(ram_size / (1 << 20))); > exit(1); > } > memory_region_init_ram(ram, NULL, "mips_r4k.ram", ram_size); > diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c > index 42bb9d5..d7d1758 100644 > --- a/hw/ppc/mac_oldworld.c > +++ b/hw/ppc/mac_oldworld.c > @@ -124,7 +124,7 @@ static void ppc_heathrow_init(QEMUMachineInitArgs *= args) > if (ram_size > (2047 << 20)) { > fprintf(stderr, > "qemu: Too much memory for this machine: %d MB, maximu= m 2047 MB\n", > - ((unsigned int)ram_size / (1 << 20))); > + (unsigned int)(ram_size / (1 << 20))); > exit(1); > } > =20 >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg