All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] efi: Start tidying up memory management
@ 2024-09-01 22:22 Simon Glass
  2024-09-01 22:22 ` [PATCH v3 1/3] efi: Drop the memset() from efi_alloc() Simon Glass
                   ` (3 more replies)
  0 siblings, 4 replies; 28+ messages in thread
From: Simon Glass @ 2024-09-01 22:22 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Ilias Apalodimas, Heinrich Schuchardt, Tom Rini, Sughosh Ganu,
	Simon Glass, AKASHI Takahiro, Eugene Uriev, Marek Vasut,
	Masahisa Kojima, Richard Weinberger, Sean Anderson,
	Vincent Stehlé

We have been discussing the state of EFI memory management for some
years so I thought it might be best to send a short series showing some
of the issues we have talked about.

This one just deals with memory allocation. It provides a way to detect
EFI 'page allocations' when U-Boot' malloc() should be used. It should
help us to clean up this area of U-Boot.

It also updates EFI to use U-Boot memory allocation for the pool. Most
functions use that anyway and it is much more efficient. It also avoids
allocating things 'in space' in conflict with the loaded images.

This series also includes a little patch to show more information in
the index for the EFI pages.

Note that this series is independent from Sugosh's lmb series[1],
although I believe it will point the way to simplifying some of the
later patches in that series.

Overall, some issues which should be resolved are:
- allocation inconsistency, e.g. efi_add_protocol() uses malloc() but
  efi_dp_dup() does not (this series makes a start)
- change efi_bl_init() to register events later, when the devices are
  actually used
- rather than efi_set_bootdev(), provide a bootstd way to take note of
  the device images came from and allow EFI to query that when needed
- EFI_LOADER_BOUNCE_BUFFER - can use U-Boot bounce buffers?

Minor questions on my mind:
- is unaligned access useful? Is there a performance penalty?
- API confusion about whether something is an address or a pointer

[1] https://patchwork.ozlabs.org/project/uboot/list/?series=416441

Changes in v3:
- Add new patch to drop the memset() from efi_alloc()
- Drop patch to convert device_path allocation to use malloc()

Changes in v2:
- Drop patch 'Show more information in efi index'
- Drop patch 'Avoid pool allocation in efi_get_memory_map_alloc()'
- Add the word 'warning', use log_warning() and show the end address

Simon Glass (3):
  efi: Drop the memset() from efi_alloc()
  efi: Allow use of malloc() for the EFI pool
  efi: Show the location of the bounce buffer

 common/dlmalloc.c            |   7 +++
 include/efi_loader.h         |  29 ++++++++-
 include/malloc.h             |   7 +++
 lib/efi_loader/efi_bootbin.c |  11 ++++
 lib/efi_loader/efi_memory.c  | 119 ++++++++++++++++++++++++-----------
 5 files changed, 136 insertions(+), 37 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2024-09-25 12:55 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-01 22:22 [PATCH v3 0/3] efi: Start tidying up memory management Simon Glass
2024-09-01 22:22 ` [PATCH v3 1/3] efi: Drop the memset() from efi_alloc() Simon Glass
2024-09-14  7:34   ` Heinrich Schuchardt
2024-09-19 14:13     ` Simon Glass
2024-09-23 12:15       ` Heinrich Schuchardt
2024-09-25 12:50         ` Simon Glass
2024-09-01 22:22 ` [PATCH v3 2/3] efi: Allow use of malloc() for the EFI pool Simon Glass
2024-09-06  6:22   ` Sughosh Ganu
2024-09-06 13:01     ` Simon Glass
2024-09-09  7:44       ` Sughosh Ganu
2024-09-10 18:44         ` Simon Glass
2024-09-11  6:49           ` Sughosh Ganu
2024-09-12  0:59             ` Simon Glass
2024-09-23 12:30               ` Heinrich Schuchardt
2024-09-25 12:48                 ` Simon Glass
2024-09-06  7:12   ` Ilias Apalodimas
2024-09-06 13:01     ` Simon Glass
2024-09-12  6:37       ` Ilias Apalodimas
2024-09-16 15:42         ` Simon Glass
2024-09-20 12:10           ` Ilias Apalodimas
2024-09-20 16:03             ` Simon Glass
2024-09-23 10:02               ` Ilias Apalodimas
2024-09-25 12:55                 ` Simon Glass
2024-09-01 22:22 ` [PATCH v3 3/3] efi: Show the location of the bounce buffer Simon Glass
2024-09-02 11:42   ` Heinrich Schuchardt
2024-09-10 18:41     ` Simon Glass
2024-09-05  7:46 ` [PATCH v3 0/3] efi: Start tidying up memory management Vincent Stehlé
2024-09-06  0:28   ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.