public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2 0/3] efi_loader: consider EFI memory map
@ 2023-01-05 20:25 Heinrich Schuchardt
  2023-01-05 20:25 ` [PATCH v2 1/3] vexpress: adjust loadaddr Heinrich Schuchardt
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Heinrich Schuchardt @ 2023-01-05 20:25 UTC (permalink / raw)
  To: Ilias Apalodimas
  Cc: Tom Rini, Liviu Dudau, Simon Glass, Stefan Roese,
	Patrick Delaunay, Jaehoon Chung, Michal Simek, Patrice Chotard,
	Ashok Reddy Soma, u-boot, Heinrich Schuchardt

As reported in Debian bug #1027176 relocation of the initrd may lead to
overwriting memory used by the EFI sub-system.

Currently the available memory for images is determined via the lmb
library functions. The lmb library has several shortcomings:

* It does not protect against overwriting one image with another.
* The same routines to find reserved memory are called again and
  again.

In the long run we should move to allocating memory for images.

As an intermediate solutions let's add lmb-reservations for all EFI memory
areas that are not EFI_CONVENTIONAL_MEMORY.

The variable $loadaddr of at least the vexpress_ca9x4 board collids with
memory used by the EFI sub-system. Adjust $loadaddr for the vexpress
boards to a sane value.

v2:
	carve out efi_get_memory_map_alloc()

Heinrich Schuchardt (3):
  vexpress: adjust loadaddr
  efi_loader: carve out efi_get_memory_map_alloc()
  lmb: consider EFI memory map

 cmd/efidebug.c                    | 18 ++++------------
 include/configs/vexpress_common.h |  1 +
 include/efi_loader.h              |  3 +++
 lib/efi_loader/efi_memory.c       | 34 +++++++++++++++++++++++++++++
 lib/lmb.c                         | 36 +++++++++++++++++++++++++++++++
 5 files changed, 78 insertions(+), 14 deletions(-)

-- 
2.37.2


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

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

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-05 20:25 [PATCH v2 0/3] efi_loader: consider EFI memory map Heinrich Schuchardt
2023-01-05 20:25 ` [PATCH v2 1/3] vexpress: adjust loadaddr Heinrich Schuchardt
2023-01-05 20:25 ` [PATCH v2 2/3] efi_loader: carve out efi_get_memory_map_alloc() Heinrich Schuchardt
2023-01-06 23:22   ` Vagrant Cascadian
2023-01-09  7:18   ` Ilias Apalodimas
2023-01-09  8:06     ` Heinrich Schuchardt
2023-01-09 13:00       ` Ilias Apalodimas
2023-01-05 20:25 ` [PATCH v2 3/3] lmb: consider EFI memory map Heinrich Schuchardt
2023-01-06 23:22   ` Vagrant Cascadian
2023-01-09  7:19   ` Ilias Apalodimas
2023-01-09 20:11   ` Simon Glass
2023-01-09 20:20     ` Mark Kettenis
2023-01-09 20:31       ` Simon Glass
2023-01-09 20:53         ` Heinrich Schuchardt
2023-01-11  0:15           ` Simon Glass
2023-01-11  7:43             ` Heinrich Schuchardt
2023-01-11 13:59               ` Tom Rini
2023-01-11 16:48                 ` Simon Glass
2023-01-11 16:59                   ` Heinrich Schuchardt
2023-01-11 17:40                     ` Mark Kettenis
2023-01-11 17:50                       ` Heinrich Schuchardt
2023-01-11 17:55                     ` Simon Glass
2023-01-11 18:03                       ` Heinrich Schuchardt
2023-01-11 21:08                         ` Simon Glass
2023-01-11 22:59                           ` Mark Kettenis
2023-01-11 23:35                             ` Heinrich Schuchardt
2023-01-12  1:13                               ` Tom Rini
2023-01-11 23:36                             ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox