search for: getmemorymap

Displaying 11 results from an estimated 11 matches for "getmemorymap".

2020 Jun 11
2
[PATCH] efi/main: add retry to exit_boot()
Sometimes the UEFI memory map changes between GetMemoryMap() and ExitBootServices(), making the MapKey value incorrect. Per the UEFI spec, the memory map should then be fetched again and exiting retried. Signed-off-by: Tom Huibregtse <thuibregtse at xes-inc.com> --- efi/main.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file chan...
2015 Nov 03
2
[PATCH] efi: Call ExitBootServices at least twice
...> + EFI_STATUS status; >>> + UINTN size, allocsizeadd; >>> + >>> + allocsizeadd = sizeof(*map) * 2; >>> + >>> + do { >>> + size = *allocsize; >>> + status = uefi_call_wrapper(BS->GetMemoryMap, 5, &size, >>> map, key, >>> + desc_sz, desc_ver); >> >> Why not check for NULL and call get_memory_map() first? > > I cannot call get_memory_map at all because I wouldn't control how > much memory is allocated,...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...us; >>>> + UINTN size, allocsizeadd; >>>> + >>>> + allocsizeadd = sizeof(*map) * 2; >>>> + >>>> + do { >>>> + size = *allocsize; >>>> + status = uefi_call_wrapper(BS->GetMemoryMap, 5, &size, >>>> map, key, >>>> + desc_sz, desc_ver); >>> >>> Why not check for NULL and call get_memory_map() first? >> >> I cannot call get_memory_map at all because I wouldn't control how >&g...
2015 Nov 02
3
[PATCH] efi: Call ExitBootServices at least twice
..., > + UINT32 *desc_ver) > +{ > + EFI_STATUS status; > + UINTN size, allocsizeadd; > + > + allocsizeadd = sizeof(*map) * 2; > + > + do { > + size = *allocsize; > + status = uefi_call_wrapper(BS->GetMemoryMap, 5, &size, map, key, > + desc_sz, desc_ver); Why not check for NULL and call get_memory_map() first? > + if (status == EFI_BUFFER_TOO_SMALL) { > + if (map) > + FreePool(map);...
2015 Aug 26
5
[PATCH] Call ExitBootServices twice
...ervices may need to be called twice in order to successfully exit the boot services. As stated by the UEFI spec, the first call to ExitBootServices may perform a partial shutdown of the services. It seems that during this partial shutdown, the memory map can be modified, thus making another call to GetMemoryMap necessary. However GetMemoryMap needs a buffer to fill, but the memory allocation functions should not be used after the first call to ExitBootServices despite still working on my hardware. This patch solve this problem as follow: - Get the memory map and allocate a buffer larger than necessary - C...
2020 Jun 18
0
[PATCH] efi/main: add retry to exit_boot()
...ts to prove that the patch works. From: "Tom Huibregtse via Syslinux" <syslinux at syslinux.org> To: syslinux at syslinux.org Sent: Thursday, June 11, 2020 8:04:06 AM Subject: [syslinux] [PATCH] efi/main: add retry to exit_boot() Sometimes the UEFI memory map changes between GetMemoryMap() and ExitBootServices(), making the MapKey value incorrect. Per the UEFI spec, the memory map should then be fetched again and exiting retried. Signed-off-by: Tom Huibregtse <thuibregtse at xes-inc.com> --- efi/main.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file...
2015 Sep 16
1
[PATCH] efi: Call ExitBootServices at least twice
...e, > + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, > + UINT32 *desc_ver) > +{ > + EFI_STATUS status; > + UINTN size, allocsizeadd; > + > + allocsizeadd = sizeof(*map) * 2; > + > + do { > + size = *allocsize; > + status = uefi_call_wrapper(BS->GetMemoryMap, 5, > &size, map, key, > + desc_sz, desc_ver); > + > + if (status == EFI_BUFFER_TOO_SMALL) { > + if (map) > + FreePool(map); > + allocsizeadd *= 2; > + *allocsize = size + allocsizeadd; > + map = AllocatePool(*allocsize); Why d...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...*desc_ver) >> +{ >> + EFI_STATUS status; >> + UINTN size, allocsizeadd; >> + >> + allocsizeadd = sizeof(*map) * 2; >> + >> + do { >> + size = *allocsize; >> + status = uefi_call_wrapper(BS->GetMemoryMap, 5, &size, >> map, key, >> + desc_sz, desc_ver); > > Why not check for NULL and call get_memory_map() first? I cannot call get_memory_map at all because I wouldn't control how much memory is allocated, and this is a crucial point t...
2015 Nov 04
1
[PATCH] efi: Call ExitBootServices at least twice
...believe it's forbidden at all since >> ExitBootServices() was NOT successful. > > I disagree with this. The documentation of ExitBootServices(), section > 6.4, say (typo included): > "If MapKey value is incorrect, ExitBootServices() returns > EFI_INVALID_PARAMETER and GetMemoryMap() with ExitBootServices() must > be called again. Firmware implementation may choose to do a partial > shutdown of the boot services during the first call to > ExitBootServices(). EFI OS loader should not make calls to any boot > service function other then GetMemoryMap() after the firs...
2015 Aug 26
0
[PATCH] efi: Call ExitBootServices at least twice
...map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, + UINT32 *desc_ver) +{ + EFI_STATUS status; + UINTN size, allocsizeadd; + + allocsizeadd = sizeof(*map) * 2; + + do { + size = *allocsize; + status = uefi_call_wrapper(BS->GetMemoryMap, 5, &size, map, key, + desc_sz, desc_ver); + + if (status == EFI_BUFFER_TOO_SMALL) { + if (map) + FreePool(map); + allocsizeadd *= 2; + *allocsize = size + allocsizeadd; + map = AllocatePool(*allocsize); + } + } while (status == EFI_BUFFER_TOO_SMALL); +...
2015 Nov 21
7
Only 2.5G of RAM available then syslinux64.efi boots 32-bit linux 686-pae
Hello, I'm booting linux-3.16-686-pae kernel (32-bit) via syslinux.efi 64-bit version. After boot linux sees only 2.5G of RAM while system has 32G installed. If I boot the same kernel with GRUB64 efi instead of syslinux then amount of RAM available to linux is 32G. Is this a bug or I'm missing something? syslinux.cfg: label live-686-pae menu label Linux (686-pae) menu