u-boot/lib/efi_loader
Stefan Brüns b61d857b2f efi_loader: Readd freed pages to memory pool
Currently each allocation creates a new mapping. Readding the mapping
as free memory (EFI_CONVENTIONAL_MEMORY) potentially allows to hand out
an existing mapping, thus limiting the number of mapping descriptors in
the memory map.

Mitigates a problem with current (4.8rc7) linux kernels when doing an
efi_get_memory map, resulting in an infinite loop. Space for the memory
map is reserved with allocate_pool (implicitly creating a new mapping) and
filled. If there is insufficient slack space (8 entries) in the map, the
space is freed and a new round is started, with space for one more entry.
As each round increases requirement and allocation by exactly one, there
is never enough slack space. (At least 32 entries are allocated, so as
long as there are less than 24 entries, there is enough slack).
Earlier kernels reserved no slack, and did less allocations, so this
problem was not visible.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
2016-10-18 09:08:07 +02:00
..
efi_boottime.c efi_loader: Track size of pool allocations to allow freeing 2016-10-18 09:08:07 +02:00
efi_console.c efi_loader: Add console interface 2016-03-15 18:03:09 -04:00
efi_disk.c efi_loader: disk: Sanitize exposed devices 2016-08-08 13:33:00 -04:00
efi_gop.c efi_loader: Add DM_VIDEO support 2016-06-06 13:39:17 -04:00
efi_image_loader.c efi_loader: Fix relocations above 64kb image size 2016-08-20 14:03:27 -04:00
efi_memory.c efi_loader: Readd freed pages to memory pool 2016-10-18 09:08:07 +02:00
efi_net.c efi_loader: Add network access support 2016-05-27 10:01:10 -04:00
efi_runtime.c efi_loader: Move to normal debug infrastructure 2016-06-06 13:39:16 -04:00
Kconfig efi_loader: Add bounce buffer support 2016-05-27 15:39:48 -04:00
Makefile efi_loader: Add network access support 2016-05-27 10:01:10 -04:00