Discussion:
[BUG] elilo blindly copies initrd on top of itself
Jonathan Barkelew
2009-03-18 21:07:15 UTC
Permalink
Good day to all.
I've been trying to track down a problem booting to UEFI-native SuSE
and I've finally cracked the code. On the system that I've been testing with,
ELILO seemed to execute all the way through, and hand off to the kernel,
but the system would hang shortly afterwards.

I've figured out that ELILO is allocating memory to load the initial
ramdisk using
an AllocatePages() call with type 'AllocateAnyPages'. This all works fine, but
shortly after calling ExitBootServices(), ELILO blindly copies the
initrd from this
location to 50MB. The problem is: the initrd memory was being allocated from
38MB to 60MB, and ELILO was copying it on top of itself.

A couple of fixes come to mind. I think perhaps the easiest of which
is to change
the AllocatePages() call to an 'AllocateAddress' type, and requesting memory
at 50MB. If this call fails with EFI_OUT_OF_RESOURCES, the memory could
be allocated elsewhere and then copied to 50MB after ExitBootServices().

Any thoughts?

--
Jonathan Barkelew
BIOS Engineer - American Megatrends
Jason Fleischli
2009-03-18 21:16:10 UTC
Permalink
Post by Jonathan Barkelew
Good day to all.
I've been trying to track down a problem booting to UEFI-native SuSE
and I've finally cracked the code. On the system that I've been testing with,
ELILO seemed to execute all the way through, and hand off to the kernel,
but the system would hang shortly afterwards.
I've figured out that ELILO is allocating memory to load the initial
ramdisk using
an AllocatePages() call with type 'AllocateAnyPages'. This all works fine, but
shortly after calling ExitBootServices(), ELILO blindly copies the
initrd from this
location to 50MB. The problem is: the initrd memory was being allocated from
38MB to 60MB, and ELILO was copying it on top of itself.
A couple of fixes come to mind. I think perhaps the easiest of which
is to change
the AllocatePages() call to an 'AllocateAddress' type, and requesting memory
at 50MB. If this call fails with EFI_OUT_OF_RESOURCES, the memory could
be allocated elsewhere and then copied to 50MB after ExitBootServices().
Any thoughts?
Ive got a patch from Stuart Hayes under test to address this very issue
for x86_64 arch. I'll port to ia32 but leave ia64 alone (ia64 has a
"kernel relocatable" option). This will be in the next elilo 3.10
release immediately following this patch integration and it is my
intention to get 3.10 released as soon as possible.

-jason

Loading...