All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Pavel Roskin <proski@gnu.org>
Cc: The development of GRUB 2 <grub-devel@gnu.org>,
	Carlos Roberto do Nascimento Costa <crncosta@linux.vnet.ibm.com>,
	Manoel <mrabran@linux.vnet.ibm.com>
Subject: Re: PPC64 mlongcall gcc flag
Date: Wed, 05 Nov 2008 11:25:15 -0600	[thread overview]
Message-ID: <1225905915.26835.71.camel@localhost.localdomain> (raw)
In-Reply-To: <1225842506.2997.21.camel@dv>

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




  parent reply	other threads:[~2008-11-05 17:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 20:52 PPC64 Hollis Blanchard
2008-10-21 22:04 ` PPC64 Pavel Roskin
2008-10-21 22:40   ` PPC64 Hollis Blanchard
2008-10-23  5:25     ` PPC64 Pavel Roskin
2008-10-23 15:06       ` PPC64 Hollis Blanchard
2008-10-23 16:52         ` PPC64 Pavel Roskin
2008-10-23 18:00 ` PPC64 Manoel
2008-10-23 19:08   ` PPC64 Hollis Blanchard
2008-10-24 12:10     ` PPC64 Manoel
2008-10-24 14:51       ` PPC64 Hollis Blanchard
2008-10-24 21:53     ` PPC64 Manoel
2008-10-27 17:19       ` PPC64 Pavel Roskin
2008-11-04 16:05         ` PPC64 Manoel
2008-11-04 16:12           ` PPC64 Hollis Blanchard
2008-11-04 18:18             ` PPC64 mlongcall gcc flag Manoel
2008-11-04 18:21               ` Manoel
2008-11-04 19:16               ` Robert Millan
2008-11-04 23:48               ` Pavel Roskin
2008-11-05  9:43                 ` Robert Millan
2008-11-05 15:35                   ` Pavel Roskin
2008-11-05 17:25                 ` Hollis Blanchard [this message]
2008-11-05 19:27                   ` Manoel
2008-11-06 15:12                   ` Robert Millan
2008-11-06 17:42                     ` Manoel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1225905915.26835.71.camel@localhost.localdomain \
    --to=hollisb@us.ibm.com \
    --cc=crncosta@linux.vnet.ibm.com \
    --cc=grub-devel@gnu.org \
    --cc=mrabran@linux.vnet.ibm.com \
    --cc=proski@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.