lkml.org 
[lkml]   [2017]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/efi: don't try to reserve runtime regions
On Tue, 04 Apr, at 04:41:55PM, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
>
> Reserving a runtime region results in splitting the efi memory
> descriptors for the runtime region. This results in runtime region
> descriptors with bogus memory mappings, leading to interesting crashes
> like the following during a kexec:

[...]

> Runtime regions will not be freed and do not need to be reserved, so
> skip the memmap modification in this case.
>
> Fixes: 8e80632fb23f ("efi/esrt: Use efi_mem_reserve() and avoid a kmalloc()")
> Signed-off-by: Omar Sandoval <osandov@fb.com>
> ---
> arch/x86/platform/efi/quirks.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
> index 30031d5293c4..cdfe8c628959 100644
> --- a/arch/x86/platform/efi/quirks.c
> +++ b/arch/x86/platform/efi/quirks.c
> @@ -201,6 +201,10 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
> return;
> }
>
> + /* No need to reserve regions that will never be freed. */
> + if (md.attribute & EFI_MEMORY_RUNTIME)
> + return;
> +
> size += addr % EFI_PAGE_SIZE;
> size = round_up(size, EFI_PAGE_SIZE);
> addr = round_down(addr, EFI_PAGE_SIZE);

Thanks Omar, I've picked this up for the urgent branch.

\
 
 \ /
  Last update: 2017-04-10 00:22    [W:0.080 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site