Skip to content
Commit fd626195 authored by Lenny Szubowicz's avatar Lenny Szubowicz Committed by Ard Biesheuvel
Browse files

efi/libstub/x86: Avoid EFI map buffer alloc in allocate_e820()



In allocate_e820(), call the EFI get_memory_map() service directly
instead of indirectly via efi_get_memory_map(). This avoids allocation
of a buffer and return of the full EFI memory map, which is not needed
here and would otherwise need to be freed.

Routine allocate_e820() only needs to know how many EFI memory
descriptors there are in the map to allocate an adequately sized
e820ext buffer, if it's needed. Note that since efi_get_memory_map()
returns a memory map buffer sized with extra headroom, allocate_e820()
now needs to explicitly factor that into the e820ext size calculation.

Signed-off-by: default avatarLenny Szubowicz <lszubowi@redhat.com>
Suggested-by: default avatarArd Biesheuvel <ardb@kernel.org>
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent 8f592ada
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment