From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46637) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S62rE-0004EN-Q2 for qemu-devel@nongnu.org; Fri, 09 Mar 2012 11:40:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S62r7-0003EK-S9 for qemu-devel@nongnu.org; Fri, 09 Mar 2012 11:39:56 -0500 Received: from smtp121.dfw.emailsrvr.com ([67.192.241.121]:46923) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S62r7-0003Di-Mn for qemu-devel@nongnu.org; Fri, 09 Mar 2012 11:39:49 -0500 Message-ID: <4F5A3267.70607@calxeda.com> Date: Fri, 09 Mar 2012 10:40:07 -0600 From: Mark Langsdorf MIME-Version: 1.0 References: <1331225951-31306-1-git-send-email-mark.langsdorf@calxeda.com> <1331308660-20787-1-git-send-email-mark.langsdorf@calxeda.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] arm highbank: force ramsize to INT_MAX when loading List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "agraf@suse.de" , "armbru@redhat.com" , "qemu-devel@nongnu.org" , "eblake@redhat.com" , "afaerber@suse.de" , "david@gibson.dropbear.id.au" On 03/09/2012 10:13 AM, Peter Maydell wrote: > On 9 March 2012 15:57, Mark Langsdorf wrote: >> Since the ram_size field of arm_boot_info is only an int, don't set >> that field to more than INT_MAX. Signed vs unsigned comparison >> overruns are possible otherwise. > > Can't we just make arm_boot_info.ram_size a uint32_t (propagating through > signedness fixes as required) ? > > Actually it should probably be a target_phys_addr_t, thinking ahead > to adding LPAE support. It really should be a size_t, per the upthread discussion with Andreas Faerber. I'll take a stab at the patch, but it touches a lot of code that I don't really have a way to test so I'm a bit dubious. --Mark Langsdorf Calxeda, Inc.