From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S78PJ-0003iH-3k for qemu-devel@nongnu.org; Mon, 12 Mar 2012 12:47:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S78Ou-0005CP-8Y for qemu-devel@nongnu.org; Mon, 12 Mar 2012 12:47:36 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46449 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S78Ot-0005Bs-Vc for qemu-devel@nongnu.org; Mon, 12 Mar 2012 12:47:12 -0400 Message-ID: <4F5E288B.1050905@suse.de> Date: Mon, 12 Mar 2012 17:47:07 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1331225951-31306-1-git-send-email-mark.langsdorf@calxeda.com> <1331570005-18492-1-git-send-email-mark.langsdorf@calxeda.com> In-Reply-To: <1331570005-18492-1-git-send-email-mark.langsdorf@calxeda.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3] use an uint64_t for the max_sz parameter in load_image_targphys List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Langsdorf Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, armbru@redhat.com, agraf@suse.de, eblake@redhat.com, david@gibson.dropbear.id.au Am 12.03.2012 17:33, schrieb Mark Langsdorf: > Allow load_image_targphys to load files on systems with more than 2G of > emulated memory by changing the max_sz parameter from an int to an > uint64_t. >=20 > Signed-off-by: Mark Langsdorf A very non-intrusive solution for allowing large theoretical limits. I've skimmed through the callers and it looks fine. Reviewed-by: Andreas F=E4rber Independently David's off_t patch or a variation thereof would still be needed to make use of the enlarged limit, wouldn't it? Image sizes remain int here. Andreas > --- > Changes from v2 > changed max_sz from target_phys_addr_t to uint64_t > Changes from v1 > changed max_sz from unsigned long to target_phys_addr_t > returned size to an int to match get_image_size >=20 > hw/loader.c | 2 +- > hw/loader.h | 3 ++- > 2 files changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/hw/loader.c b/hw/loader.c > index 415cdce..7d64113 100644 > --- a/hw/loader.c > +++ b/hw/loader.c > @@ -103,7 +103,7 @@ ssize_t read_targphys(const char *name, > =20 > /* return the size or -1 if error */ > int load_image_targphys(const char *filename, > - target_phys_addr_t addr, int max_sz) > + target_phys_addr_t addr, uint64_t max_sz) > { > int size; > =20 > diff --git a/hw/loader.h b/hw/loader.h > index fbcaba9..6da291e 100644 > --- a/hw/loader.h > +++ b/hw/loader.h > @@ -4,7 +4,8 @@ > /* loader.c */ > int get_image_size(const char *filename); > int load_image(const char *filename, uint8_t *addr); /* deprecated */ > -int load_image_targphys(const char *filename, target_phys_addr_t, int = max_sz); > +int load_image_targphys(const char *filename, target_phys_addr_t, > + uint64_t max_sz); > int load_elf(const char *filename, uint64_t (*translate_fn)(void *, ui= nt64_t), > void *translate_opaque, uint64_t *pentry, uint64_t *lowad= dr, > uint64_t *highaddr, int big_endian, int elf_machine, --=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