Received: from eggs.gnu.org ([208.118.235.92]:50868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S65Nu-00075r-Pu for qemu-devel@nongnu.org; Fri, 09 Mar 2012 14:22:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S65No-00032K-Hh for qemu-devel@nongnu.org; Fri, 09 Mar 2012 14:21:50 -0500 Received: from cantor2.suse.de ([195.135.220.15]:51873 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S65No-000328-8E for qemu-devel@nongnu.org; Fri, 09 Mar 2012 14:21:44 -0500 Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: Alexander Graf In-Reply-To: <4F5A541A.8040203@suse.de> Date: Fri, 9 Mar 2012 20:21:41 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1331225951-31306-1-git-send-email-mark.langsdorf@calxeda.com> <1331308660-20787-1-git-send-email-mark.langsdorf@calxeda.com> <4F5A3267.70607@calxeda.com> <4F5A541A.8040203@suse.de> 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: =?iso-8859-1?Q?Andreas_F=E4rber?= Cc: Peter Maydell , Mark Langsdorf , "qemu-devel@nongnu.org" , "armbru@redhat.com" , "eblake@redhat.com" , "david@gibson.dropbear.id.au" On 09.03.2012, at 20:03, Andreas F=E4rber wrote: > Am 09.03.2012 19:22, schrieb Alexander Graf: >>=20 >> On 09.03.2012, at 17:40, Mark Langsdorf wrote: >>=20 >>> 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. >>>>=20 >>>> Can't we just make arm_boot_info.ram_size a uint32_t (propagating = through >>>> signedness fixes as required) ? >>>>=20 >>>> Actually it should probably be a target_phys_addr_t, thinking ahead >>>> to adding LPAE support. >>>=20 >>> It really should be a size_t, per the upthread discussion with = Andreas >>> Faerber. >>=20 >> No, Andreas is wrong. Host data types have nothing to do in target = ram fiddling code. The type you're searching for is "the size of = physical address space the guest can handle" and that's = target_phys_addr_t. Period. >=20 > That is exactly where we disagree: It's not "target ram fiddling = code". >=20 > It's the host loading binaries from disk to host RAM. No, it's an offset into guest RAM. Right now the interface is using target_phys_addr_t addr int size what if instead if would be using target_phys_addr_t start target_phys_addr_t end It would still be the same thing semantically. We have a start address = and an end address that we can put data in. The fact that the image is = backed by some POSIX layers in the background is a minor detail. It = could just as well go through the block layer and be read via libcurl = from http. The semantic of size is addr + size =3D end Alex