grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] efi: improved correctness, arm unification, and cleanup
@ 2017-02-28 22:35 Leif Lindholm
  2017-02-28 22:35 ` [PATCH 1/7] efi: add grub_efi_get_dram_base() function for arm* Leif Lindholm
                   ` (8 more replies)
  0 siblings, 9 replies; 20+ messages in thread
From: Leif Lindholm @ 2017-02-28 22:35 UTC (permalink / raw)
  To: grub-devel; +Cc: Alexander Graf, ard.biesheuvel, Gerd Hoffmann, Laszlo Ersek

This patch series is really three different ones, but they unite around
the need for (and the implementation) of more flexible control of memory
allocation on UEFI systems.

1: Adding new interfaces
- A function for detecting the start address of RAM
  Since ARM platforms have no standardised memory map, implement a
  function that picks the lowest-address region supporting the
  write-back cache atribute from the UEFI memory map.
- Implement and expose a new memory allocation function giving access to
  the allocation type and memory type arguments to the AllocatePages
  boot service.

2: ARM unificatios
- The fdt helper library for arm64/efi is really an efi/fdt function.
  So move it to neutral ground in loader/efi.
- The arm64 efi linux loader was written for arm64 only, so clean it up a
  bit with regards to 32/64-bit portability, and abstract out some
  definitions and function prototypes.
- Move the arm efi port to use the arm64 linux loader instead of the one
  shared with the u-boot port. Clean up the u-boot loder by deleting the
  efi-specific bits and other code only used by that.

3: Correctness improvements
- There are some restrictions on the placement of initrd images in
  relation to the runtime kernel images, for both arm and arm64 - but the
  arm64 one did not use to be explicitly documented (and only triggerable
  on systems with > 40GB of RAM), and the u-boot loader always placed the
  images nearly adjacent. Use the new interfaces to place the initrd as
  approrpiate for each architecture.
- The allocation of memory for the grub heap is done of memory type
  GRUB_EFI_LOADER_DATA. Since UEFI can return memory with non-executable
  mappings for this request, and modules are loaded onto the heap, change
  this allocation GRUB_EFI_LOADER_CODE instead.

Leif Lindholm (7):
  efi: add grub_efi_get_dram_base() function for arm*
  efi: refactor grub_efi_allocate_pages
  efi: move fdt helper library
  arm64: make efi linux loader more generic
  arm: reuse arm64 linux loader on efi systems
  efi: restrict arm/arm64 linux loader initrd placement
  efi: change heap allocation type to GRUB_EFI_LOADER_CODE

 grub-core/Makefile.am                 |   1 -
 grub-core/Makefile.core.def           |   6 +-
 grub-core/kern/arm/efi/misc.c         | 202 ----------------------------------
 grub-core/kern/efi/mm.c               |  92 ++++++++++++----
 grub-core/loader/arm/linux.c          |  48 +-------
 grub-core/loader/arm64/linux.c        |  73 ++++++++----
 grub-core/loader/arm64/xen_boot.c     |  15 +--
 grub-core/loader/{arm64 => efi}/fdt.c |  11 +-
 include/grub/arm/efi/loader.h         |  26 -----
 include/grub/arm/efi/memory.h         |   3 +
 include/grub/arm/linux.h              |  30 ++---
 include/grub/arm64/efi/memory.h       |   3 +
 include/grub/arm64/linux.h            |  13 +--
 include/grub/efi/efi.h                |  10 ++
 include/grub/{arm64 => efi}/fdtload.h |   3 -
 include/grub/efi/pe32.h               |   2 +
 16 files changed, 176 insertions(+), 362 deletions(-)
 delete mode 100644 grub-core/kern/arm/efi/misc.c
 rename grub-core/loader/{arm64 => efi}/fdt.c (93%)
 delete mode 100644 include/grub/arm/efi/loader.h
 rename include/grub/{arm64 => efi}/fdtload.h (89%)

-- 
2.11.0



^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH 0/7] efi: improved correctness, arm unification, and cleanup
@ 2017-06-12 14:53 Leif Lindholm
  2017-06-12 14:53 ` [PATCH 7/7] efi: change heap allocation type to GRUB_EFI_LOADER_CODE Leif Lindholm
  0 siblings, 1 reply; 20+ messages in thread
From: Leif Lindholm @ 2017-06-12 14:53 UTC (permalink / raw)
  To: grub-devel; +Cc: agraf, kraxel, lersek, ard.biesheuvel

This patch series is really three different ones, but they unite around
the need for (and the implementation) of more flexible control of memory
allocation on UEFI systems.

1: Adding new interfaces
- A function for detecting the start address of RAM
  Since ARM platforms have no standardised memory map, implement a
  function that picks the lowest-address region supporting the
  write-back cache atribute from the UEFI memory map.
- Implement and expose a new memory allocation function giving access to
  the allocation type and memory type arguments to the AllocatePages
  boot service.

2: ARM unification
- The fdt helper library for arm64-efi is really an efi/fdt function.
  So move it to neutral ground in loader/efi.
- The arm64 efi linux loader was written for arm64 only, so clean it up a
  bit with regards to 32/64-bit portability, and abstract out some
  definitions and function prototypes.
- Move the arm efi port to use the arm64 linux loader instead of the one
  shared with the u-boot port. Clean up the u-boot loder by deleting the
  efi-specific bits and other code only used by that.

3: Correctness improvements
- There are some restrictions on the placement of initrd images in
  relation to the runtime kernel images, for both arm and arm64 - but the
  arm64 one did not use to be explicitly documented (and only triggerable
  on systems with > 40GB of RAM), and the u-boot loader always placed the
  images nearly adjacent. Use the new interfaces to place the initrd as
  approrpiate for each architecture.
- The allocation of memory for the grub heap is done of memory type
  GRUB_EFI_LOADER_DATA. Since UEFI can return memory with non-executable
  mappings for this request, and modules are loaded onto the heap, change
  this allocation to GRUB_EFI_LOADER_CODE instead.

I first sent this series out on 28 February this year.
Changes since previous submission:
- Rebased (to deal with arm coreboot upstream changes).
- Moved EFI page size definitions to common header.
- Moved a few stray 32/64-bit fixes from 3/7 to 4/7.

Leif Lindholm (7):
  efi: add grub_efi_get_dram_base() function for arm*
  efi: refactor grub_efi_allocate_pages
  efi: move fdt helper library
  arm64: make efi linux loader more generic
  arm: reuse arm64 linux loader on efi systems
  efi: restrict arm/arm64 linux loader initrd placement
  efi: change heap allocation type to GRUB_EFI_LOADER_CODE

 grub-core/Makefile.am                 |   1 -
 grub-core/Makefile.core.def           |   6 +-
 grub-core/kern/arm/efi/misc.c         | 202 ----------------------------------
 grub-core/kern/efi/mm.c               |  92 ++++++++++++----
 grub-core/loader/arm/linux.c          |  39 +------
 grub-core/loader/arm64/linux.c        |  73 ++++++++----
 grub-core/loader/arm64/xen_boot.c     |  15 +--
 grub-core/loader/{arm64 => efi}/fdt.c |  11 +-
 include/grub/arm/efi/loader.h         |  26 -----
 include/grub/arm/efi/memory.h         |   3 +
 include/grub/arm/linux.h              |  30 ++---
 include/grub/arm64/linux.h            |  13 +--
 include/grub/efi/efi.h                |  10 ++
 include/grub/{arm64 => efi}/fdtload.h |   3 -
 include/grub/efi/memory.h             |   3 +
 include/grub/efi/pe32.h               |   2 +
 16 files changed, 176 insertions(+), 353 deletions(-)
 delete mode 100644 grub-core/kern/arm/efi/misc.c
 rename grub-core/loader/{arm64 => efi}/fdt.c (93%)
 delete mode 100644 include/grub/arm/efi/loader.h
 rename include/grub/{arm64 => efi}/fdtload.h (89%)

-- 
2.11.0



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-08-01 12:13 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-28 22:35 [PATCH 0/7] efi: improved correctness, arm unification, and cleanup Leif Lindholm
2017-02-28 22:35 ` [PATCH 1/7] efi: add grub_efi_get_dram_base() function for arm* Leif Lindholm
2017-02-28 22:35 ` [PATCH 2/7] efi: refactor grub_efi_allocate_pages Leif Lindholm
2017-02-28 22:35 ` [PATCH 3/7] efi: move fdt helper library Leif Lindholm
2017-02-28 22:35 ` [PATCH 4/7] arm64: make efi linux loader more generic Leif Lindholm
2017-02-28 22:35 ` [PATCH 5/7] arm: reuse arm64 linux loader on efi systems Leif Lindholm
2017-02-28 22:35 ` [PATCH 6/7] efi: restrict arm/arm64 linux loader initrd placement Leif Lindholm
2017-02-28 22:35 ` [PATCH 7/7] efi: change heap allocation type to GRUB_EFI_LOADER_CODE Leif Lindholm
2017-02-28 22:51 ` [PATCH 0/7] efi: improved correctness, arm unification, and cleanup Vladimir 'phcoder' Serbinenko
2017-03-01 10:31   ` Leif Lindholm
2017-03-08  7:57 ` Gerd Hoffmann
2017-03-08  8:00   ` Ard Biesheuvel
  -- strict thread matches above, loose matches on Subject: below --
2017-06-12 14:53 Leif Lindholm
2017-06-12 14:53 ` [PATCH 7/7] efi: change heap allocation type to GRUB_EFI_LOADER_CODE Leif Lindholm
2017-07-27 15:29   ` Daniel Kiper
2017-07-27 15:33     ` Vladimir 'phcoder' Serbinenko
2017-07-27 15:44       ` Daniel Kiper
2017-07-27 15:45         ` Vladimir 'phcoder' Serbinenko
2017-07-27 16:06           ` Daniel Kiper
2017-07-28 21:35             ` Leif Lindholm
2017-08-01 12:13               ` Daniel Kiper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).