Skip to content

Commit 67633dd

Browse files
Andy WhitcroftAndrea Righi
authored andcommitted
UBUNTU: SAUCE: efi: efi_get_memory_map -- increase map headroom
We are seeing some EFI based machines failing to boot hard in the EFI stub: exit_boot() failed! efi_main() failed! This seems to occur when the bootloader (grub2 in this case) has had to manipulate some additional files due to a change in the way MAAS boots the machines. We tracked this down to the memory map dance efi_get_memory_map(). Basically we attempt to close boot services and it informs us it cannot do so because it failed to record the updated memory map. This occurs when there is insufficient space in the passed memory map buffer to record changes during the operation. At the point when this occurs we are unable to call the allocation functions to reallocate the buffer so we panic. To avoid this we allocate some additional entries in the buffer to cover any additional entries. This headroom is currently insufficient for these machines under this use case. Increase EFI_MMAP_NR_SLACK_SLOTS to provide space for more memory map modifications. BugLink: https://bugs.launchpad.net/bugs/1851810 Signed-off-by: Andy Whitcroft <[email protected]> Signed-off-by: Seth Forshee <[email protected]>
1 parent 22136de commit 67633dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/efi/libstub/efistub.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void efi_set_u64_split(u64 data, u32 *lo, u32 *hi)
135135
* the EFI memory map. Other related structures, e.g. x86 e820ext, need
136136
* to factor in this headroom requirement as well.
137137
*/
138-
#define EFI_MMAP_NR_SLACK_SLOTS 8
138+
#define EFI_MMAP_NR_SLACK_SLOTS 16
139139

140140
struct efi_boot_memmap {
141141
efi_memory_desc_t **map;

0 commit comments

Comments
 (0)