public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: will.deacon@arm•com (Will Deacon)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v4 3/3] arm64/efi: isolate EFI stub from the kernel proper
Date: Fri, 9 Oct 2015 10:10:37 +0100	[thread overview]
Message-ID: <20151009091037.GC26278@arm.com> (raw)
In-Reply-To: <CAPAsAGz7Tp6Z87tPq_NNh_mcwPF_DOaXzu0po5f6AQxPAcsALQ@mail.gmail.com>

On Fri, Oct 09, 2015 at 11:12:24AM +0300, Andrey Ryabinin wrote:
> 2015-10-08 22:02 GMT+03:00 Ard Biesheuvel <ard.biesheuvel@linaro•org>:
> > --- a/arch/arm64/kernel/image.h
> > +++ b/arch/arm64/kernel/image.h
> > @@ -59,4 +59,31 @@
> >         _kernel_offset_le       = DATA_LE64(TEXT_OFFSET);       \
> >         _kernel_flags_le        = DATA_LE64(__HEAD_FLAGS);
> >
> > +#ifdef CONFIG_EFI
> > +
> > +/*
> > + * The EFI stub has its own symbol namespace prefixed by __efistub_, to
> > + * isolate it from the kernel proper. The following symbols are legally
> > + * accessed by the stub, so provide some aliases to make them accessible.
> > + * Only include data symbols here, or text symbols of functions that are
> > + * guaranteed to be safe when executed at another offset than they were
> > + * linked at. The routines below are all implemented in assembler in a
> > + * position independent manner
> > + */
> > +__efistub_memcmp               = __pi_memcmp;
> > +__efistub_memchr               = __pi_memchr;
> > +__efistub_memcpy               = __pi_memcpy;
> > +__efistub_memmove              = __pi_memmove;
> > +__efistub_memset               = __pi_memset;
> > +__efistub_strlen               = __pi_strlen;
> > +__efistub_strcmp               = __pi_strcmp;
> > +__efistub_strncmp              = __pi_strncmp;
> > +__efistub___flush_dcache_area  = __pi___flush_dcache_area;
> 
> So why we need these __pi_* aliases?
> We could just do __efistub_memcmp = memcmp; Right?

We *could*, but that defeats the whole purpose of tagging
position-independent functions explicitly in the kernel text.

Will

  reply	other threads:[~2015-10-09  9:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 19:02 [PATCH v4 0/3] arm64: EFI stub isolation Ard Biesheuvel
2015-10-08 19:02 ` [PATCH v4 1/3] arm64/efi: remove /chosen/linux, uefi-stub-kern-ver DT property Ard Biesheuvel
2015-10-10 22:31   ` [PATCH v4 1/3] arm64/efi: remove /chosen/linux,uefi-stub-kern-ver " Matt Fleming
2015-10-08 19:02 ` [PATCH v4 2/3] arm64: use ENDPIPROC() to annotate position independent assembler routines Ard Biesheuvel
2015-10-08 19:02 ` [PATCH v4 3/3] arm64/efi: isolate EFI stub from the kernel proper Ard Biesheuvel
2015-10-09  8:12   ` Andrey Ryabinin
2015-10-09  9:10     ` Will Deacon [this message]
2015-10-09  9:40       ` Andrey Ryabinin
2015-10-09  9:43         ` Will Deacon
2015-10-09  9:48           ` Andrey Ryabinin
2015-10-10 22:40   ` Matt Fleming
2015-10-26 22:26   ` Jeremy Linton
2015-10-26 22:33     ` Jeremy Linton
2015-10-27  2:20       ` Ard Biesheuvel
2015-10-27 14:44         ` Jeremy Linton
2015-10-30 12:17           ` Ard Biesheuvel
2015-10-30 14:35             ` Mark Rutland
2015-10-30 16:01             ` Catalin Marinas
2015-11-02 12:49         ` Matt Fleming
2015-11-24  9:34   ` Robert Richter
2015-11-24  9:38     ` Ard Biesheuvel
2015-10-10 22:40 ` [PATCH v4 0/3] arm64: EFI stub isolation Matt Fleming
2015-10-12 15:30   ` Catalin Marinas

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=20151009091037.GC26278@arm.com \
    --to=will.deacon@arm$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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