From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Kxm8L-0000HH-Lb for mharc-grub-devel@gnu.org; Wed, 05 Nov 2008 12:25:33 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kxm8J-0000GQ-3r for grub-devel@gnu.org; Wed, 05 Nov 2008 12:25:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kxm8H-0000Fk-Bk for grub-devel@gnu.org; Wed, 05 Nov 2008 12:25:30 -0500 Received: from [199.232.76.173] (port=48267 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kxm8H-0000FX-2k for grub-devel@gnu.org; Wed, 05 Nov 2008 12:25:29 -0500 Received: from e33.co.us.ibm.com ([32.97.110.151]:56403) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kxm8D-0008HF-Ar; Wed, 05 Nov 2008 12:25:25 -0500 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e33.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id mA5HOwst005678; Wed, 5 Nov 2008 10:24:58 -0700 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mA5HPGMO103780; Wed, 5 Nov 2008 10:25:16 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mA5HPGUp009180; Wed, 5 Nov 2008 10:25:16 -0700 Received: from [9.53.41.42] (slate.austin.ibm.com [9.53.41.42]) by d03av01.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id mA5HPF2t009123; Wed, 5 Nov 2008 10:25:15 -0700 From: Hollis Blanchard To: Pavel Roskin In-Reply-To: <1225842506.2997.21.camel@dv> References: <1224622323.31194.81.camel@localhost.localdomain> <1224784802.9254.56.camel@manoel-laptop> <1224788935.16720.38.camel@localhost.localdomain> <1224885201.7358.53.camel@manoel-laptop> <1225127982.4991.7.camel@dv> <1225814725.6767.20.camel@manoel-laptop> <1225815138.15410.19.camel@localhost.localdomain> <1225822685.6767.28.camel@manoel-laptop> <1225842506.2997.21.camel@dv> Content-Type: text/plain Organization: IBM Linux Technology Center Date: Wed, 05 Nov 2008 11:25:15 -0600 Message-Id: <1225905915.26835.71.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: The development of GRUB 2 , Carlos Roberto do Nascimento Costa , Manoel Subject: Re: PPC64 mlongcall gcc flag X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Nov 2008 17:25:31 -0000 On Tue, 2008-11-04 at 18:48 -0500, Pavel Roskin wrote: > > However, it would be nice to have a better explanation why "-mlongcall" > is needed. If it's only needed for modules and has significant > overhead, we may want to introduce MODULE_CFLAGS, which would only be > used for modules. It absolutely should only be used for modules. It's needed because a PowerPC branch instruction can only target +/- 32MB. -mlongcall replaces the direct branch with an indirect one (using mtctr/bctrl instructions). This can target the full 32-bit address space. > By the way, I tried cross-compiling for PowerPC with and without > "-mlongcall" with gcc 4.2.4. With "-mlongcall", the size of all modules > combined is 426424 bytes. Without "-mlongcall", the size of all modules > combined is 354464 bytes. That's a significant difference for a > bootloader and should be avoided if possible. To be fair, if we are that worried about footprint, why do we have a runtime ELF linker in a bootloader? At any rate, the point of having dynamically loadable modules is so you can only load the ones you need. On that scale I think the size increase is less of an issue. > Maybe there is a way to keep the modules and the core in the first 32 > megabytes? Actually I'm confused about something here Manoel. Module memory is allocated by grub_malloc(), but as you can see at http://svn.savannah.gnu.org/viewvc/trunk/grub2/kern/ieee1275/init.c?revision=1806&root=grub&view=markup the GRUB heap capped at 4MB (I don't mean size, I mean the end of the heap). So how are your modules appearing in memory above 32MB? -- Hollis Blanchard IBM Linux Technology Center