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

Submitted by:  stuart hayes <stuart_hayes>
Submitted on:  Wed 23 May 2012 07:33:10 PM UTC  
 
Category: BootingSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: stuart_hayes
Open/Closed: ClosedRelease: 
Release: otherReproducibility: 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>
Project 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>

 

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
  • -unavailable- added by phcoder (Posted a comment)
  • -unavailable- added by stuart_hayes (Submitted the item)
  • -unavailable- added by stuart_hayes
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 31 May 2012 11:29:07 AM UTCphcoderStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 23 May 2012 07:33:10 PM UTCstuart_hayesAttached File-=>Added grub-1.99-upstream_efimm_late_malloc_3.patch, #25912
      Carbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1