From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S77r8-0006p7-Sg for qemu-devel@nongnu.org; Mon, 12 Mar 2012 12:12:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S77r1-0005gb-UX for qemu-devel@nongnu.org; Mon, 12 Mar 2012 12:12:18 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44191 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S77r1-0005g9-LF for qemu-devel@nongnu.org; Mon, 12 Mar 2012 12:12:11 -0400 Message-ID: <4F5E2059.7040606@suse.de> Date: Mon, 12 Mar 2012 17:12:09 +0100 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1331225951-31306-1-git-send-email-mark.langsdorf@calxeda.com> <4F5A0288.6090809@calxeda.com> <9A556F7F-2721-4D51-80D2-8B9571E4EC0F@suse.de> <4F5A06C8.7020903@calxeda.com> <88D21EA9-1000-48DB-9D7A-437622BE8745@suse.de> <4F5A1378.5040909@suse.de> <4F5A503D.2090304@suse.de> <4F5B6069.404@suse.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] use an unsigned long for the max_sz parameter in load_image_targphys List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Alexander Graf , Mark Langsdorf , Stefan Weil , "qemu-devel@nongnu.org" , Markus Armbruster , Erik Blake , David Gibson Am 10.03.2012 16:27, schrieb Peter Maydell: > On 10 March 2012 14:08, Andreas F=C3=A4rber wrote: >> Am 10.03.2012 14:51, schrieb Peter Maydell: >>> "Length of a block of memory on the guest" is what I meant. >>> What you need is "an integer type large enough to hold the >>> difference between two guest pointer values". The size of >>> that type should depend only on the guest config, not on the >>> host, so 'unsigned long', 'size_t', 'off_t' etc are all wrong. >> >> Your view is very ARM-centric. >=20 > I don't understand this remark. Nothing about the above explanation > is ARM-centric [snip] ARM-centric is that you and Mark are trying to solve the issue of ARM boards supplying guest RAM size as limit for image loading. I'm saying many other boards don't have that issue because they're using a constant size value way below any theoretical limit. Now the theory behind this part of the thread is about what type to use for a delta vs. absolute value. If you subtract void * from void * you get a ptrdiff_t. Similarly in C# or Java or whatever subtracing two Time objects will return a TimeDiff object or so. Whether you specify a temperature in degrees Celsius or Kelvin, the difference is in degrees. In that same spirit I'm opposed to using target_phys_addr_t for a size (delta) between two addresses. HTE. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg