On Wed, 2008-11-05 at 11:25 -0600, Hollis Blanchard wrote:
> 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
> ihttp://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?
> 
I'm not sure why ( I didnt look at that part of the source code yet).
If I understand correctly the heap should only use address in the range
0x - 0x400000 (0 - 4mb).

The total modules size until the moment of failure (reallocation
overflow) is around 120 kb , then it shouldn't be a lack of memory
problem.

In the attachment we can see that the modules are relocated in a
decreasing order of address.
the firsts modules are relocated in the address range  0x2a990->0x262f0
 (in small steps). Then relocated to the address range 0x8ab0->0x4830
(small steps again).

Note that grub jumps from the address 0x262f0 to 0x8ab0., probably
because grub itself is using this address space(grub is linked at
0x10000).
until there all is ok.

but then it tries to relocate to the address 0x208f6b0 and the
"relocation overflow" problem happens.

In the P5 machine the behavior is very similar but the address 0x1c6f6b0
is used and all goes fine.


could it be a bug in the grub memory manager?
Attached is the debug information of the modules relocation in both P5
and P6.

-- 
Best Regards,

Manoel Abranches <[EMAIL PROTECTED]>
IBM Linux Technology Center Brazil
../kern/dl.c:527: module at 0x2c018, size 0xa84
../kern/dl.c:556: relocating to 0x2a990
../kern/dl.c:513: flushing 0x14 bytes at 0x2a450
../kern/dl.c:513: flushing 0x58 bytes at 0x2a4a0
../kern/dl.c:513: flushing 0x410 bytes at 0x2a530
../kern/dl.c:570: module name: acorn
../kern/dl.c:571: init function: 0x2a910
../kern/dl.c:527: module at 0x2caa8, size 0xe28
../kern/dl.c:556: relocating to 0x2a340
../kern/dl.c:513: flushing 0x88 bytes at 0x29b70
../kern/dl.c:513: flushing 0x6b8 bytes at 0x29c30
../kern/dl.c:570: module name: fshelp
../kern/dl.c:571: init function: 0x0
../kern/dl.c:527: module at 0x2d8dc, size 0x1758
../kern/dl.c:556: relocating to 0x299f0
../kern/dl.c:513: flushing 0x4 bytes at 0x28d60
../kern/dl.c:513: flushing 0x20 bytes at 0x28da0
../kern/dl.c:513: flushing 0x7c bytes at 0x28df0
../kern/dl.c:513: flushing 0xad8 bytes at 0x28ea0
../kern/dl.c:570: module name: affs
../kern/dl.c:571: init function: 0x29934
../kern/dl.c:527: module at 0x2f040, size 0x2374
../kern/dl.c:556: relocating to 0x28c70
../kern/dl.c:513: flushing 0x4 bytes at 0x27100
../kern/dl.c:513: flushing 0x20 bytes at 0x27140
../kern/dl.c:513: flushing 0x1c bytes at 0x27190
../kern/dl.c:513: flushing 0x1a20 bytes at 0x271e0
../kern/dl.c:570: module name: afs
../kern/dl.c:571: init function: 0x28bbc
../kern/dl.c:527: module at 0x313c0, size 0xb4c
../kern/dl.c:556: relocating to 0x27010
../kern/dl.c:513: flushing 0x4 bytes at 0x26af0
../kern/dl.c:513: flushing 0x14 bytes at 0x26b30
../kern/dl.c:513: flushing 0x54 bytes at 0x26b80
../kern/dl.c:513: flushing 0x3a4 bytes at 0x26c10
../kern/dl.c:570: module name: amiga
../kern/dl.c:571: init function: 0x26f70
../kern/dl.c:527: module at 0x31f18, size 0xcd0
../kern/dl.c:556: relocating to 0x269e0
../kern/dl.c:513: flushing 0x4 bytes at 0x26400
../kern/dl.c:513: flushing 0x14 bytes at 0x26440
../kern/dl.c:513: flushing 0xfc bytes at 0x26490
../kern/dl.c:513: flushing 0x3d0 bytes at 0x265c0
../kern/dl.c:570: module name: apple
../kern/dl.c:571: init function: 0x2694c
../kern/dl.c:527: module at 0x32bf4, size 0xe6d8
../kern/dl.c:556: relocating to 0x262f0
../kern/dl.c:513: flushing 0x69c bytes at 0x24970
../kern/dl.c:513: flushing 0x42 bytes at 0x25040
../kern/dl.c:513: flushing 0x4 bytes at 0x250c0
../kern/dl.c:513: flushing 0xc90 bytes at 0x25100
../kern/dl.c:513: flushing 0x4b8 bytes at 0x25dc0
../kern/dl.c:513: flushing 0x7358 bytes at 0x8c90
../kern/dl.c:570: module name: normal
../kern/dl.c:571: init function: 0xc180
../kern/dl.c:527: module at 0x412d8, size 0xa48
../kern/dl.c:556: relocating to 0x8ab0
../kern/dl.c:513: flushing 0x90 bytes at 0x8630
../kern/dl.c:513: flushing 0x34c bytes at 0x86f0
../kern/dl.c:570: module name: blocklist
../kern/dl.c:571: init function: 0x871c
../kern/dl.c:527: module at 0x41d2c, size 0x5a8
../kern/dl.c:556: relocating to 0x84b0
../kern/dl.c:513: flushing 0x38 bytes at 0x8310
../kern/dl.c:513: flushing 0xbc bytes at 0x8380
../kern/dl.c:570: module name: boot
../kern/dl.c:571: init function: 0x83ac
../kern/dl.c:527: module at 0x422e0, size 0x9d4
../kern/dl.c:556: relocating to 0x81b0
../kern/dl.c:513: flushing 0x20 bytes at 0x7c40
../kern/dl.c:513: flushing 0x8 bytes at 0x7c90
../kern/dl.c:513: flushing 0x488 bytes at 0x7cd0
../kern/dl.c:570: module name: bufio
../kern/dl.c:571: init function: 0x0
../kern/dl.c:527: module at 0x42cc0, size 0x2328
../kern/dl.c:556: relocating to 0x7b40
../kern/dl.c:513: flushing 0x114 bytes at 0x6090
../kern/dl.c:513: flushing 0xe0 bytes at 0x61e0
../kern/dl.c:513: flushing 0x70 bytes at 0x62f0
../kern/dl.c:513: flushing 0x1758 bytes at 0x6390
../kern/dl.c:570: module name: gzio
../kern/dl.c:571: init function: 0x0
../kern/dl.c:527: module at 0x44ff4, size 0x89c
../kern/dl.c:556: relocating to 0x5f90
../kern/dl.c:513: flushing 0x4c bytes at 0x5cd0
../kern/dl.c:513: flushing 0x1b0 bytes at 0x5d50
../kern/dl.c:570: module name: cat
../kern/dl.c:571: init function: 0x5d7c
../kern/dl.c:527: module at 0x4589c, size 0x9d8
../kern/dl.c:556: relocating to 0x5b70
../kern/dl.c:513: flushing 0xd0 bytes at 0x5760
../kern/dl.c:513: flushing 0x27c bytes at 0x5860
../kern/dl.c:570: module name: cmp
../kern/dl.c:571: init function: 0x588c
../kern/dl.c:527: module at 0x46280, size 0x8c8
../kern/dl.c:556: relocating to 0x5600
../kern/dl.c:513: flushing 0xa0 bytes at 0x5320
../kern/dl.c:513: flushing 0x1a0 bytes at 0x53f0
../kern/dl.c:570: module name: configfile
../kern/dl.c:571: init function: 0x5434
../kern/dl.c:527: module at 0x46b54, size 0xffc
../kern/dl.c:556: relocating to 0x5100
../kern/dl.c:513: flushing 0x4 bytes at 0x4920
../kern/dl.c:513: flushing 0x20 bytes at 0x4960
../kern/dl.c:513: flushing 0x70 bytes at 0x49b0
../kern/dl.c:513: flushing 0x660 bytes at 0x4a50
../kern/dl.c:570: module name: cpio
../kern/dl.c:571: init function: 0x506c
../kern/dl.c:527: module at 0x47b5c, size 0x8b4
../kern/dl.c:556: relocating to 0x4830
../kern/dl.c:513: flushing 0x400 bytes at 0x4030
../kern/dl.c:513: flushing 0x54 bytes at 0x4480
../kern/dl.c:513: flushing 0x2a8 bytes at 0x4510
../kern/dl.c:570: module name: crc
../kern/dl.c:571: init function: 0x453c
../kern/dl.c:527: module at 0x4841c, size 0x1eb8
../kern/dl.c:556: relocating to 0x1c6f6b0
../kern/dl.c:513: flushing 0x8 bytes at 0x1c6e4f0
../kern/dl.c:513: flushing 0x8 bytes at 0x1c6e530
../kern/dl.c:513: flushing 0x20 bytes at 0x1c6e570
../kern/dl.c:513: flushing 0x148 bytes at 0x1c6e5c0
../kern/dl.c:513: flushing 0x58 bytes at 0x1c6e740
../kern/dl.c:513: flushing 0xe88 bytes at 0x1c6e7d0
../kern/dl.c:570: module name: raid
../kern/dl.c:571: init function: 0x1c6f278
../kern/dl.c:527: module at 0x4a2e0, size 0x85c
../kern/dl.c:556: relocating to 0x1c6e240
../kern/dl.c:513: flushing 0xc bytes at 0x1c6dee0
../kern/dl.c:513: flushing 0x64 bytes at 0x1c6df20
../kern/dl.c:513: flushing 0x208 bytes at 0x1c6dfc0
../kern/dl.c:570: module name: dm_nv
../kern/dl.c:571: init function: 0x1c6dfec

../kern/dl.c:527: module at 0x2c018, size 0xa84
../kern/dl.c:556: relocating to 0x2a990
../kern/dl.c:513: flushing 0x14 bytes at 0x2a450
../kern/dl.c:513: flushing 0x58 bytes at 0x2a4a0
../kern/dl.c:513: flushing 0x410 bytes at 0x2a530
../kern/dl.c:570: module name: acorn
../kern/dl.c:571: init function: 0x2a910
../kern/dl.c:527: module at 0x2caa8, size 0xe28
../kern/dl.c:556: relocating to 0x2a340
../kern/dl.c:513: flushing 0x88 bytes at 0x29b70
../kern/dl.c:513: flushing 0x6b8 bytes at 0x29c30
../kern/dl.c:570: module name: fshelp
../kern/dl.c:571: init function: 0x0
../kern/dl.c:527: module at 0x2d8dc, size 0x1758
../kern/dl.c:556: relocating to 0x299f0
../kern/dl.c:513: flushing 0x4 bytes at 0x28d60
../kern/dl.c:513: flushing 0x20 bytes at 0x28da0
../kern/dl.c:513: flushing 0x7c bytes at 0x28df0
../kern/dl.c:513: flushing 0xad8 bytes at 0x28ea0
../kern/dl.c:570: module name: affs
../kern/dl.c:571: init function: 0x29934
../kern/dl.c:527: module at 0x2f040, size 0x2374
../kern/dl.c:556: relocating to 0x28c70
../kern/dl.c:513: flushing 0x4 bytes at 0x27100
../kern/dl.c:513: flushing 0x20 bytes at 0x27140
../kern/dl.c:513: flushing 0x1c bytes at 0x27190
../kern/dl.c:513: flushing 0x1a20 bytes at 0x271e0
../kern/dl.c:570: module name: afs
../kern/dl.c:571: init function: 0x28bbc
../kern/dl.c:527: module at 0x313c0, size 0xb4c
../kern/dl.c:556: relocating to 0x27010
../kern/dl.c:513: flushing 0x4 bytes at 0x26af0
../kern/dl.c:513: flushing 0x14 bytes at 0x26b30
../kern/dl.c:513: flushing 0x54 bytes at 0x26b80
../kern/dl.c:513: flushing 0x3a4 bytes at 0x26c10
../kern/dl.c:570: module name: amiga
../kern/dl.c:571: init function: 0x26f70
../kern/dl.c:527: module at 0x31f18, size 0xcd0
../kern/dl.c:556: relocating to 0x269e0
../kern/dl.c:513: flushing 0x4 bytes at 0x26400
../kern/dl.c:513: flushing 0x14 bytes at 0x26440
../kern/dl.c:513: flushing 0xfc bytes at 0x26490
../kern/dl.c:513: flushing 0x3d0 bytes at 0x265c0
../kern/dl.c:570: module name: apple
../kern/dl.c:571: init function: 0x2694c
../kern/dl.c:527: module at 0x32bf4, size 0xe6d8
../kern/dl.c:556: relocating to 0x262f0
../kern/dl.c:513: flushing 0x69c bytes at 0x24970
../kern/dl.c:513: flushing 0x42 bytes at 0x25040
../kern/dl.c:513: flushing 0x4 bytes at 0x250c0
../kern/dl.c:513: flushing 0xc90 bytes at 0x25100
../kern/dl.c:513: flushing 0x4b8 bytes at 0x25dc0
../kern/dl.c:513: flushing 0x7358 bytes at 0x8c90
../kern/dl.c:570: module name: normal
../kern/dl.c:571: init function: 0xc180
../kern/dl.c:527: module at 0x412d8, size 0xa48
../kern/dl.c:556: relocating to 0x8ab0
../kern/dl.c:513: flushing 0x90 bytes at 0x8630
../kern/dl.c:513: flushing 0x34c bytes at 0x86f0
../kern/dl.c:570: module name: blocklist
../kern/dl.c:571: init function: 0x871c
../kern/dl.c:527: module at 0x41d2c, size 0x5a8
../kern/dl.c:556: relocating to 0x84b0
../kern/dl.c:513: flushing 0x38 bytes at 0x8310
../kern/dl.c:513: flushing 0xbc bytes at 0x8380
../kern/dl.c:570: module name: boot
../kern/dl.c:571: init function: 0x83ac
../kern/dl.c:527: module at 0x422e0, size 0x9d4
../kern/dl.c:556: relocating to 0x81b0
../kern/dl.c:513: flushing 0x20 bytes at 0x7c40
../kern/dl.c:513: flushing 0x8 bytes at 0x7c90
../kern/dl.c:513: flushing 0x488 bytes at 0x7cd0
../kern/dl.c:570: module name: bufio
../kern/dl.c:571: init function: 0x0
../kern/dl.c:527: module at 0x42cc0, size 0x2328
../kern/dl.c:556: relocating to 0x7b40
../kern/dl.c:513: flushing 0x114 bytes at 0x6090
../kern/dl.c:513: flushing 0xe0 bytes at 0x61e0
../kern/dl.c:513: flushing 0x70 bytes at 0x62f0
../kern/dl.c:513: flushing 0x1758 bytes at 0x6390
../kern/dl.c:570: module name: gzio
../kern/dl.c:571: init function: 0x0
../kern/dl.c:527: module at 0x44ff4, size 0x89c
../kern/dl.c:556: relocating to 0x5f90
../kern/dl.c:513: flushing 0x4c bytes at 0x5cd0
../kern/dl.c:513: flushing 0x1b0 bytes at 0x5d50
../kern/dl.c:570: module name: cat
../kern/dl.c:571: init function: 0x5d7c
../kern/dl.c:527: module at 0x4589c, size 0x9d8
../kern/dl.c:556: relocating to 0x5b70
../kern/dl.c:513: flushing 0xd0 bytes at 0x5760
../kern/dl.c:513: flushing 0x27c bytes at 0x5860
../kern/dl.c:570: module name: cmp
../kern/dl.c:571: init function: 0x588c
../kern/dl.c:527: module at 0x46280, size 0x8c8
../kern/dl.c:556: relocating to 0x5600
../kern/dl.c:513: flushing 0xa0 bytes at 0x5320
../kern/dl.c:513: flushing 0x1a0 bytes at 0x53f0
../kern/dl.c:570: module name: configfile
../kern/dl.c:571: init function: 0x5434
../kern/dl.c:527: module at 0x46b54, size 0xffc
../kern/dl.c:556: relocating to 0x5100
../kern/dl.c:513: flushing 0x4 bytes at 0x4920
../kern/dl.c:513: flushing 0x20 bytes at 0x4960
../kern/dl.c:513: flushing 0x70 bytes at 0x49b0
../kern/dl.c:513: flushing 0x660 bytes at 0x4a50
../kern/dl.c:570: module name: cpio
../kern/dl.c:571: init function: 0x506c
../kern/dl.c:527: module at 0x47b5c, size 0x8b4
../kern/dl.c:556: relocating to 0x4830
../kern/dl.c:513: flushing 0x400 bytes at 0x4030
../kern/dl.c:513: flushing 0x54 bytes at 0x4480
../kern/dl.c:513: flushing 0x2a8 bytes at 0x4510
../kern/dl.c:570: module name: crc
../kern/dl.c:571: init function: 0x453c
../kern/dl.c:527: module at 0x4841c, size 0x1eb8
../kern/dl.c:556: relocating to 0x208f6b0
Relocation overflow
Aborted. Press any key to exit.
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to