From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5hpc-0000ya-Os for qemu-devel@nongnu.org; Thu, 08 Mar 2012 13:12:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5hpY-0007T1-3u for qemu-devel@nongnu.org; Thu, 08 Mar 2012 13:12:52 -0500 Received: from smtp171.dfw.emailsrvr.com ([67.192.241.171]:59940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5hpX-0007Sb-VU for qemu-devel@nongnu.org; Thu, 08 Mar 2012 13:12:48 -0500 Message-ID: <4F58F6B0.10000@calxeda.com> Date: Thu, 08 Mar 2012 12:13:04 -0600 From: Mark Langsdorf MIME-Version: 1.0 References: <1331225951-31306-1-git-send-email-mark.langsdorf@calxeda.com> <4F58F2BE.90809@redhat.com> In-Reply-To: <4F58F2BE.90809@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: Eric Blake Cc: "david@gibson.dropbear.id.au" , "qemu-devel@nongnu.org" , "agraf@suse.de" On 03/08/2012 11:56 AM, Eric Blake wrote: > On 03/08/2012 09:59 AM, Mark Langsdorf wrote: >> 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 >> unsigned long. > > unsigned long is still 32-bits on a 32-bit host. You probably want to > be using off_t. I know that unsigned long is 32-bits. The issue is more that comparing 0xf000_0000 > 0x1000_0000 returns FALSE if both values are compared as signed ints, the way the current code does. Strict correctness would be for max_sz to be of type size_t, and I can change it to that if people would prefer, but unsigned long is clear enough in this instance. --Mark Langsdorf Calxeda, Inc.