linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	linux-efi <linux-efi@vger.kernel.org>,
	Will Deacon <will@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 0/2] efi/arm64: execute the kernel in place if possible
Date: Fri, 27 Mar 2020 17:39:26 +0100	[thread overview]
Message-ID: <CAMj1kXHCs8N3AHjhToseAaLAE4VWi_yC=BF6nru9M3gASJz6Jw@mail.gmail.com> (raw)
In-Reply-To: <20200327131900.000068aa@Huawei.com>

On Fri, 27 Mar 2020 at 14:19, Jonathan Cameron
<Jonathan.Cameron@huawei.com> wrote:
>
> On Thu, 26 Mar 2020 17:59:03 +0100
> Ard Biesheuvel <ardb@kernel.org> wrote:
>
> > Update the relocation logic in the EFI stub for arm64 so it runs the
> > kernel in place if it was loaded by firmware at an address which allows
> > doing so. Then, update the PE/COFF header metadata and increase the
> > section alignment to force the UEFI image loader to honour the minimal
> > alignment requirement imposed by the kernel proper.
> >
> > Ard Biesheuvel (2):
> >   efi/libstub/arm64: avoid copying the kernel unnecessarily
> >   efi/arm64: increase the PE/COFF alignment so the kernel can run in
> >     place
> >
> >  arch/arm64/kernel/efi-header.S            | 2 +-
> >  arch/arm64/kernel/image-vars.h            | 7 +++++++
> >  drivers/firmware/efi/libstub/arm64-stub.c | 9 +++++++++
> >  3 files changed, 17 insertions(+), 1 deletion(-)
> >
> Hi Ard.
>
> Seems sensible to me so I decided to give it a quick test.
> As things stand RELOCATABLE is only selectable by selecting
> RANDOMIZE_BASE.   Probably want to be able to configure it
> separately (needs some help text, or a specific option to
> select CONFIG_RELOCATABLE).
>

The idea is really that KASLR kernels that were booted without a seed
(or with 'nokaslr' on the command line) take this path. But in fact, I
realized that the same logic applies to non-relocatable kernels, just
with an alignment of 2 MB rather than 64 KB or 128 KB. So I will be
sending a v2 that looks slightly different. (Another thing that I
realized is that /if/ the KASLR path fails for any reason, we could
still take this path instead of doing the allocation)

> Otherwise, superficially seems to work good for me doing a
> boot via pxe/grub on a Kunpeng 920 with some prints added to
> make sure it's taking the right paths.
>

Excellent! Thanks for testing, and I will be cc'ing you on v2.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2020-03-27 16:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26 16:59 [PATCH 0/2] efi/arm64: execute the kernel in place if possible Ard Biesheuvel
2020-03-26 16:59 ` [PATCH 1/2] efi/libstub/arm64: avoid copying the kernel unnecessarily Ard Biesheuvel
2020-03-26 16:59 ` [PATCH 2/2] efi/arm64: increase the PE/COFF alignment so the kernel can run in place Ard Biesheuvel
2020-03-28 14:06   ` Arvind Sankar
2020-03-28 14:10     ` Ard Biesheuvel
2020-03-27 13:19 ` [PATCH 0/2] efi/arm64: execute the kernel in place if possible Jonathan Cameron
2020-03-27 16:39   ` Ard Biesheuvel [this message]

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='CAMj1kXHCs8N3AHjhToseAaLAE4VWi_yC=BF6nru9M3gASJz6Jw@mail.gmail.com' \
    --to=ardb@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=will@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).