From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ard Biesheuvel Subject: Re: [PATCH v3] Fix allocation size calculations Date: Mon, 31 Oct 2016 07:57:40 +0000 Message-ID: References: <20161025163634.11893-1-roy.franz@hpe.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Roy Franz Cc: Matt Fleming , "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Roy Franz List-Id: linux-efi@vger.kernel.org On 25 October 2016 at 19:03, Ard Biesheuvel wrote: > On 25 October 2016 at 17:36, Roy Franz wrote: >> Adjust the size used in calculations to match the actual size of allocation >> that will be performed based on EFI size/alignment constraints. >> efi_high_alloc() and efi_low_alloc() use the passed size in bytes directly >> to find space in the memory map for the allocation, rather than the actual >> allocation size that has been adjusted for size and alignment constraints. >> This results in failed allocations and retries in efi_high_alloc(). The >> same error is present in efi_low_alloc(), although failure will only happen >> if the lowest memory block is small. >> Also use EFI_PAGE_SIZE consistently and remove use of EFI_PAGE_SHIFT to >> calculate page size. >> >> Signed-off-by: Roy Franz > > Reviewed-by: Ard Biesheuvel > Applied, thanks.