All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Fleming <matt@codeblueprint.co.uk>
To: Omar Sandoval <osandov@osandov.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Dave Young <dyoung@redhat.com>, Ingo Molnar <mingo@kernel.org>,
	Peter Jones <pjones@redhat.com>,
	linux-kernel@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] x86/efi: don't try to reserve runtime regions
Date: Sun, 9 Apr 2017 23:21:42 +0100	[thread overview]
Message-ID: <20170409222142.GA32464@codeblueprint.co.uk> (raw)
In-Reply-To: <52d0b66c20ed7712eebcd82e642983e2877fbceb.1491349117.git.osandov@fb.com>

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.

  reply	other threads:[~2017-04-09 22:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04 23:41 [PATCH] x86/efi: don't try to reserve runtime regions Omar Sandoval
2017-04-09 22:21 ` Matt Fleming [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-04-12 15:27 [GIT PULL] EFI urgent fix Matt Fleming
2017-04-12 15:27 ` [PATCH] x86/efi: Don't try to reserve runtime regions Matt Fleming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170409222142.GA32464@codeblueprint.co.uk \
    --to=matt@codeblueprint.co.uk \
    --cc=ard.biesheuvel@linaro.org \
    --cc=dyoung@redhat.com \
    --cc=kernel-team@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=osandov@osandov.com \
    --cc=pjones@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.