bugGNU GRUB - Bugs: bug #36532, boot in EFI mode (x86_64) fails on...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #36532: boot in EFI mode (x86_64) fails on some systems

Submitter:  stuart hayes <stuart_hayes>
Submitted:  Wed 23 May 2012 07:33:10 PM UTC
   
 
Category:  Booting Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name:  stuart_hayes
Open/Closed:  Closed Release:  other
Release:  Reproducibility:  Every Time
Planned Release:  None

Thu 31 May 2012 11:29:07 AM UTC, comment #1: 

Considering that my request for testing on ML staid unanswered, closing bugreport.

Vladimir Serbinenko <phcoder>
Group administrator
Wed 23 May 2012 07:33:10 PM UTC, original submission:  

Grub v 1.99 is failing to boot on certain systems in EFI mode.

This was discovered on some Dell 12G server systems (the PowerEdge R720, for example), using Ubuntu 12.04, but the issue was reproduced with vanilla grub 1.99.  Some systems will boot under certain circumstances (I have one R720 that will boot if I hit "F11" to go into a UEFI boot menu and then boot, but not if the system tries to boot with no manual intervention), other systems will not boot at all.

The problem is that grub2 is failing to get the EFI memory map in grub-core/loader/i386/linux.c, when it calls grub_efi_finish_boot_services(), because the buffer it allocated for the EFI memory map earlier in allocate_pages() (in the same file) is not big enough.  (The EFI memory map has grown considerably--like 50000 bytes or so--between the time that the efi_mmap_buf was set up in allocate_pages() and the time it is used in grub_efi_finish_boot_services()).

When allocate_pages() runs, it really has no way to know how large the EFI memory map will be when it needs that buffer.  Also, the EFI memory map does not need to be at an address under 1MB, either.

I've made a patch that modifies allocate_pages() so that it no longer allocates a buffer for the EFI memory map.  Instead, the buffer is allocated right before the call to grub_efi_finish_boot_services() in grub-linux_boot(), and it tries to put it at the top of memory (or just below the initrd, if one is loaded).

I have verified that this fixes the issue on my systems.

I'm attaching the patch.

stuart hayes <stuart_hayes>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #25912:  grub-1.99-upstream_efimm_late_malloc_3.patch added by stuart_hayes (6KiB - application/octet-stream - patch to allocate EFI mmap buffer later)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by stuart_hayes (Submitted the item)
  • -email is unavailable- added by stuart_hayes
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-05-31 phcoder StatusNone Fixed
        Open/ClosedOpen Closed
    2012-05-23 stuart_hayes Attached File- Added grub-1.99-upstream_efimm_late_malloc_3.patch, #25912
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code