search for: allocatepool

Displaying 12 results from an estimated 12 matches for "allocatepool".

2015 Nov 04
1
[PATCH] efi: Call ExitBootServices at least twice
...t how ExitBootServices can fail > and must be called again, I think "first call" definitely include the > case when this first call failed. I somehow missed that when I was reading. Thank you. Given this, why not allocate a pool much larger than needed to prevent the need to call AllocatePool() after the first attempted call to ExitBootServices()? Would it be better to be just additive? Or perhaps multiplicative with a minimum (ie, the greater of 16 or double the suggested size)? Is adding 4 the first round enough? Or would adding 8 or 16 be better? -- -Gene
2015 Nov 03
2
[PATCH] efi: Call ExitBootServices at least twice
...EFI_BUFFER_TOO_SMALL) { >>> + if (map) >>> + FreePool(map); >>> + allocsizeadd *= 2; >>> + *allocsize = size + allocsizeadd; >>> + map = AllocatePool(*allocsize); >>> + } >> >> Why guess at the exact size needed? GetMemoryMap is required to tell >> us the exact resize needed in the return of "size", even in UEFI v2.0. >> Was there a system that didn't follow this? > > There are...
2015 Nov 02
3
[PATCH] efi: Call ExitBootServices at least twice
...st? > + if (status == EFI_BUFFER_TOO_SMALL) { > + if (map) > + FreePool(map); > + allocsizeadd *= 2; > + *allocsize = size + allocsizeadd; > + map = AllocatePool(*allocsize); > + } Why guess at the exact size needed? GetMemoryMap is required to tell us the exact resize needed in the return of "size", even in UEFI v2.0. Was there a system that didn't follow this? > + } while (status == EFI_BUFFER_TOO_SMALL); > +...
2013 Nov 26
2
syslinux.efi pxeboot across multiple subnets
On 11/24/2013 03:29 AM, Gene Cumm wrote: >> >> (Sorry for the top posting.) > > I just started examining this and find it odd that the core_udp_recv() > doesn't zalloc() its token while core_udp_send()/core_udp_sendto() do. > All three are a part of commit fe283b78 by Matt Fleming. Should this > be made into a zalloc() rather than pushing it into the stack?
2015 Aug 26
5
[PATCH] Call ExitBootServices twice
From: Sylvain Gault <sylvain.gault at gmail.com> On some architecture, including my hardware, the function ExitBootServices 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
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...) { >>>> + if (map) >>>> + FreePool(map); >>>> + allocsizeadd *= 2; >>>> + *allocsize = size + allocsizeadd; >>>> + map = AllocatePool(*allocsize); >>>> + } >>> >>> Why guess at the exact size needed? GetMemoryMap is required to tell >>> us the exact resize needed in the return of "size", even in UEFI v2.0. >>> Was there a system that didn't follow this?...
2015 Sep 16
1
[PATCH] efi: Call ExitBootServices at least twice
...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 don't you use ReallocatePool()? Besides, you could just return inside loop when GetMemoryMap() returns EFI_SUCCESS and thus avoiding to check twice for EFI_BUFFER_TOO_SMALL prior to "status == EFI_SUCCESS" outside loop. Thanks, Paulo > + } > + } while (sta...
2020 Jun 11
2
[PATCH] efi/main: add retry to exit_boot()
...mp;key, + &desc_sz, + &desc_ver); + if (!buf_sz) + return -1; + + /* + * Allocate a pool double the size of the map in + * case if the first call to ExitBootServices() + * fails and the memory map grows before + * GetMemoryMap() is called again. + */ + buf_sz *= 2; + map = AllocatePool(buf_sz); + /* Build efi memory map */ - map = get_memory_map(&nr_entries, &key, &desc_sz, &desc_ver); - if (!map) + map_sz = buf_sz; + status = uefi_call_wrapper(BS->GetMemoryMap, + 5, + &map_sz, + map, + &key, + &desc_sz, + &...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...if (status == EFI_BUFFER_TOO_SMALL) { >> + if (map) >> + FreePool(map); >> + allocsizeadd *= 2; >> + *allocsize = size + allocsizeadd; >> + map = AllocatePool(*allocsize); >> + } > > Why guess at the exact size needed? GetMemoryMap is required to tell > us the exact resize needed in the return of "size", even in UEFI v2.0. > Was there a system that didn't follow this? There are two different things happenin...
2015 Aug 26
0
[PATCH] efi: Call ExitBootServices at least twice
...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); + + if (status == EFI_SUCCESS) { + *nr_entries = size / *desc_sz; + return map; + } + + if (map) + FreePool(map); + return NULL; +} + static int exit_boot(struct boot_params *bp) { struct e820_entry *e820buf, *e; EFI_MEMORY_DESC...
2013 Nov 28
0
syslinux.efi pxeboot across multiple subnets
...he stack > in others looks odd. It is worth noting that the Syslinux malloc > implementation is rather slow. > > -hpa At least in these particular implementations of these functions, we're probably not using Syslinux's malloc() since it's all EFI and appears to use AllocatePool() (unless I misread it). -- -Gene
2020 Jun 18
0
[PATCH] efi/main: add retry to exit_boot()
...+ &key, + &desc_sz, + &desc_ver); + if (!buf_sz) + return -1; + + /* + * Allocate a pool double the size of the map in + * case if the first call to ExitBootServices() + * fails and the memory map grows before + * GetMemoryMap() is called again. + */ + buf_sz *= 2; + map = AllocatePool(buf_sz); + /* Build efi memory map */ - map = get_memory_map(&nr_entries, &key, &desc_sz, &desc_ver); - if (!map) + map_sz = buf_sz; + status = uefi_call_wrapper(BS->GetMemoryMap, + 5, + &map_sz, + map, + &key, + &desc_sz, + &desc_ver); + if (!map) {...