From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VenwB-0003d4-RG for qemu-devel@nongnu.org; Fri, 08 Nov 2013 10:25:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Venw5-0003n8-Bq for qemu-devel@nongnu.org; Fri, 08 Nov 2013 10:25:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:23673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Venw5-0003mz-1r for qemu-devel@nongnu.org; Fri, 08 Nov 2013 10:25:25 -0500 Message-ID: <527D02FD.2000109@redhat.com> Date: Fri, 08 Nov 2013 16:27:57 +0100 From: Laszlo Ersek MIME-Version: 1.0 References: <1383859470.2527.64.camel@localhost.localdomain> <1383863039-18875-1-git-send-email-lersek@redhat.com> <1383863039-18875-2-git-send-email-lersek@redhat.com> <527CFE42.9090407@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] i386/pc: propagate flash size from pc_system_flash_init() to pc_init1() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Marcel Apfelbaum , Jan Kiszka , "edk2-devel@lists.sourceforge.net" , qemu-devel , "Michael S. Tsirkin" , Anthony Liguori , Paolo Bonzini , Jordan Justen , afaerber , Richard Henderson On 11/08/13 16:16, Peter Maydell wrote: > On 8 November 2013 15:07, Laszlo Ersek wrote: >> On 11/08/13 07:09, Jordan Justen wrote: >>> int64_t? :) >> >> Heh, yes, I did cringe when I wrote that, but if you check the >> bottom-most function, where the assignment happens, >> pc_system_flash_init(), it declares the local "size" variable as >> int64_t. I've given up on arguing for sensible unsigned types so I just >> went with the flow > > That's a bug in that function which should be fixed. > This is a memory region size and those are uint64_t. > > That said, having to pass the size of a sub-sub-region > all the way back up the call stack is very odd and makes > me wonder if it's really the right way to do it... > The top level shouldn't have to care like that about > details of the bottom of the callstack. I agree. It's just that system.flash and pci-hole are siblings in the same container (they shouldn't overlap, *or* they should have clearly different priorities between them). We have two call chains rooted in pc_init1(), and the "ends" of those chains need to coordinate with each other (they set up the two regions, respectively, and both need the boundary between them). We could introduce a new global, but that's not exactly a step forward :) Thanks Laszlo