Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors

2015-02-13 Thread Mark Rutland
On Fri, Feb 13, 2015 at 04:04:48PM +, Matt Fleming wrote: On Thu, 12 Feb, at 11:31:02PM, Ard Biesheuvel wrote: Actually, looking again at the original patch, it appears that my analysis was incorrect regarding the possibility that the loop would never terminate. The only thing that

Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors

2015-02-13 Thread Ard Biesheuvel
On 14 Feb 2015, at 00:04, Matt Fleming m...@codeblueprint.co.uk wrote: On Thu, 12 Feb, at 11:31:02PM, Ard Biesheuvel wrote: Actually, looking again at the original patch, it appears that my analysis was incorrect regarding the possibility that the loop would never terminate. The only

Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors

2015-02-13 Thread Matt Fleming
On Thu, 12 Feb, at 11:31:02PM, Ard Biesheuvel wrote: Actually, looking again at the original patch, it appears that my analysis was incorrect regarding the possibility that the loop would never terminate. The only thing that could happen if desc_size sizeof(efi_memory_desc_t) is that you

Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors

2015-02-12 Thread Mark Rutland
On Thu, Feb 12, 2015 at 05:24:19AM +, Ard Biesheuvel wrote: As it turns out, when allocating room for the UEFI memory map using UEFI's AllocatePool (), it may result in two new memory map entries being created, for instance, when using Tianocore's preallocated region feature. For example,

Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors

2015-02-12 Thread Ard Biesheuvel
On 12 February 2015 at 18:22, Mark Rutland mark.rutl...@arm.com wrote: On Thu, Feb 12, 2015 at 05:24:19AM +, Ard Biesheuvel wrote: As it turns out, when allocating room for the UEFI memory map using UEFI's AllocatePool (), it may result in two new memory map entries being created, for

Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors

2015-02-12 Thread Mark Rutland
On Thu, Feb 12, 2015 at 10:39:46AM +, Ard Biesheuvel wrote: On 12 February 2015 at 18:22, Mark Rutland mark.rutl...@arm.com wrote: On Thu, Feb 12, 2015 at 05:24:19AM +, Ard Biesheuvel wrote: As it turns out, when allocating room for the UEFI memory map using UEFI's AllocatePool (),

Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors

2015-02-12 Thread Roy Franz
On Thu, Feb 12, 2015 at 12:24 AM, Ard Biesheuvel ard.biesheu...@linaro.org wrote: As it turns out, when allocating room for the UEFI memory map using UEFI's AllocatePool (), it may result in two new memory map entries being created, for instance, when using Tianocore's preallocated region

Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors

2015-02-12 Thread Matt Fleming
On Thu, 12 Feb, at 06:39:46PM, Ard Biesheuvel wrote: I don't see how doing a single allocation could result in a single free region to be split into more than 1 occupied region + 2 free regions. So no, I don't think it is ... I don't think that's a guarantee we can make, nor is it something

Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors

2015-02-12 Thread Ard Biesheuvel
On 12 February 2015 at 22:47, Matt Fleming m...@codeblueprint.co.uk wrote: On Thu, 12 Feb, at 06:39:46PM, Ard Biesheuvel wrote: I don't see how doing a single allocation could result in a single free region to be split into more than 1 occupied region + 2 free regions. So no, I don't think

Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors

2015-02-12 Thread Mark Rutland
On Thu, Feb 12, 2015 at 02:56:51PM +, Ard Biesheuvel wrote: On 12 February 2015 at 22:47, Matt Fleming m...@codeblueprint.co.uk wrote: On Thu, 12 Feb, at 06:39:46PM, Ard Biesheuvel wrote: I don't see how doing a single allocation could result in a single free region to be split into

Re: [PATCH] efi: get_memory_map: add sufficient slack for memory descriptors

2015-02-12 Thread Ard Biesheuvel
On 12 February 2015 at 23:16, Mark Rutland mark.rutl...@arm.com wrote: On Thu, Feb 12, 2015 at 02:56:51PM +, Ard Biesheuvel wrote: On 12 February 2015 at 22:47, Matt Fleming m...@codeblueprint.co.uk wrote: On Thu, 12 Feb, at 06:39:46PM, Ard Biesheuvel wrote: I don't see how doing a