bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Stuart_Hayes
Subject: RE: [bug #36532] boot in EFI mode (x86_64) fails on some systems
Date: Tue, 12 Jun 2012 16:00:12 -0500

> > -
> > -  mmap_size = (1 << 12);
> > -  while (1)
> > -    {
> > -      int ret;
> > -      grub_efi_memory_descriptor_t *mmap;
> > -      grub_efi_uintn_t desc_size;
> > -
> > -      mmap = grub_malloc (mmap_size);
> > -      if (! mmap)
> > -   return 0;
> > -
> > -      ret = grub_efi_get_memory_map (&mmap_size, mmap, 0, &desc_size,
> 0);
> > -      grub_free (mmap);
> > -
> > -      if (ret < 0)
> > -   {
> > -     grub_error (GRUB_ERR_IO, "cannot get memory map");
> > -     return 0;
> > -   }
> > -      else if (ret > 0)
> > -   break;
> > -
> > -      mmap_size += (1 << 12);
> > -    }
> > +  if (grub_efi_get_memory_map (&mmap_size, mmap_buf, 0, &desc_size,
> 0) < 0)
> > +    return grub_error (GRUB_ERR_IO, "couldn't retrieve memory map");
> Please don't do this change. It's meant as workaround if EFI doesn't
> actually update mmap_size. I'll look into as to why my patch crashed.
> 

Well, this works, too (on top of HEAD from 7 june).


--- ../../grub/grub-core/loader/i386/linux.c    2012-05-31 12:59:19.000000000 
-0400
+++ grub-core/loader/i386/linux.c       2012-06-12 20:47:51.455718055 -0400
@@ -139,7 +139,7 @@ find_efi_mmap_size (void)
 
   /* Increase the size a bit for safety, because GRUB allocates more on
      later, and EFI itself may allocate more.  */
-  mmap_size += (1 << 12);
+  mmap_size += (3 << 12);
 
   mmap_size = page_align (mmap_size);
   return mmap_size;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]