[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 7/7] efi: change heap allocation type to GRUB_EFI_LOADER_CODE
From: |
Leif Lindholm |
Subject: |
Re: [PATCH 7/7] efi: change heap allocation type to GRUB_EFI_LOADER_CODE |
Date: |
Fri, 28 Jul 2017 22:35:38 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Thu, Jul 27, 2017 at 06:06:18PM +0200, Daniel Kiper wrote:
> > > > > > diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
> > > > > > index 7b1763bc5..f27a48e68 100644
> > > > > > --- a/grub-core/kern/efi/mm.c
> > > > > > +++ b/grub-core/kern/efi/mm.c
> > > > > > @@ -404,7 +404,9 @@ add_memory_regions (grub_efi_memory_descriptor_t
> > > > > *memory_map,
> > > > > > pages = required_pages;
> > > > > > }
> > > > > >
> > > > > > - addr = grub_efi_allocate_pages (start, pages);
> > > > > > + addr = grub_efi_allocate_pages_real (start, pages,
> > > > > > + GRUB_EFI_ALLOCATE_ADDRESS,
> > > > > > + GRUB_EFI_LOADER_CODE);
> > > > >
> > > > > Is it really needed? Is any module exectued in place or does it
> > > > > contain
> > > > > code ready to run out of the box?
> > > > >
> > > > All the modules are loaded to heap
> > >
> > > I do not see why modules have to be loaded into memory region with
> > > GRUB_EFI_LOADER_CODE type.
> >
> > He means grub modules not initrd or multiboot modules
>
> Ahhh... Right, then it should be correct. Though I would double
> check it applies to GRUB2 modules only.
It applies to any executable code running until an operating system
takes over.
Don't get me wrong - this is more of a workaround than a fix for the
grub module loading. But properly separating code/data and ro/rw
regions is a much more invasive change which deserves more discussion.
/
Leif