lkml.org 
[lkml]   [2013]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/18] Enforce minimum alignment of 1 page on allocations.
On Sun, 22 Sep, at 03:45:30PM, Roy Franz wrote:
> The efi_high_alloc() and efi_low_alloc() functions
> use the EFI_ALLOCATE_ADDRESS option to the EFI
> function allocate_pages(), which requires a minimum
> of page alignment, and rejects all other requests.
> The existing code could fail to allocate depending
> on allocation size, as although repeated allocation
> attempts were made, none were guaranteed to be page
> aligned.
>
>
>
> Signed-off-by: Roy Franz <roy.franz@linaro.org>
> Acked-by: Mark Salter <msalter@redhat.com>
> Reviewed-by: Grant Likely <grant.likely@linaro.org>
> ---
> drivers/firmware/efi/efi-stub-helper.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)

[...]

> + /* Enforce minimum alignment that EFI requires when requesting
> + * a specific address. We are doing page-based allocations,
> + * so we must be aligned to a page.
> + */
> + if (align < EFI_PAGE_SIZE)
> + align = EFI_PAGE_SIZE;
> +

FYI I manually fixed up these comments to use the multi-line form, e.g.

/*
* Enforce minimum alignment that EFI requires when requesting
* a specific address. We are doing page-based allocations,
* so we must be aligned to a page.
*/

so that they match the rest of the comments in the file.

--
Matt Fleming, Intel Open Source Technology Center


\
 
 \ /
  Last update: 2013-09-25 14:21    [W:0.262 / U:2.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site