linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Ard Biesheuvel <ardb@kernel.org>,
	linux-efi <linux-efi@vger.kernel.org>,
	Andy Lutomirski <luto@kernel.org>,
	"the arch/x86 maintainers" <x86@kernel.org>
Subject: Re: [PATCH 1/2] efi/libstub/x86: use const attribute for efi_is_64bit()
Date: Wed, 8 Jan 2020 16:25:41 +0100	[thread overview]
Message-ID: <CAKv+Gu9bPdCB6=YhDNjPL-S3oWexeEf0wLDuvo-kr0HZ31Feeg@mail.gmail.com> (raw)
In-Reply-To: <CAKv+Gu80MujqKcyxAu9M_dR90cbcHo2_UDrHjuCLO_B0Adm7YQ@mail.gmail.com>

On Wed, 8 Jan 2020 at 16:25, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>
> On Wed, 8 Jan 2020 at 16:23, Arvind Sankar <nivedita@alum.mit.edu> wrote:
> >
> > On Wed, Jan 08, 2020 at 08:45:01AM +0100, Ard Biesheuvel wrote:
> > > Reshuffle the x86 stub code a bit so that we can tag the efi_is_64bit()
> > > function with the 'const' attribute, which permits the compiler to
> > > optimize away any redundant calls. Since we have two different entry
> > > points for 32 and 64 bit firmware in the startup code, this also
> > > simplifies the C code since we'll enter it with the efi_is64 variable
> > > already set.
> > >
> > > Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> > > ---
> > >  arch/x86/boot/compressed/eboot.c   | 14 ++++++--------
> > >  arch/x86/boot/compressed/head_64.S |  7 +++----
> > >  arch/x86/include/asm/efi.h         |  2 +-
> > >  3 files changed, 10 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
> > > index 4afd29eb5b34..ab3a40283db7 100644
> > > --- a/arch/x86/boot/compressed/eboot.c
> > > +++ b/arch/x86/boot/compressed/eboot.c
> > > @@ -21,16 +21,18 @@
> > >  #include "eboot.h"
> > >
> > >  static efi_system_table_t *sys_table;
> > > -static bool efi_is64 = IS_ENABLED(CONFIG_X86_64);
> > > +extern const bool efi_is64;
> > >
> >
> > Didn't we need to declare this with hidden visibility? Or use the
> > #pragma GCC visibility push(hidden)?
>
> Yes. So this patch depends on

https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git/commit/?h=next&id=c71339946177f235aa1f750b2dc556ede3288c23

which is part of the open PR to the TIP maintainers.

  reply	other threads:[~2020-01-08 15:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08  7:45 [PATCH 0/2] efi/libstub/x86: two more tweaks for the EFI stub startup code Ard Biesheuvel
2020-01-08  7:45 ` [PATCH 1/2] efi/libstub/x86: use const attribute for efi_is_64bit() Ard Biesheuvel
2020-01-08 15:23   ` Arvind Sankar
2020-01-08 15:25     ` Ard Biesheuvel
2020-01-08 15:25       ` Ard Biesheuvel [this message]
2020-01-08 15:27         ` Arvind Sankar
2020-01-08  7:45 ` [PATCH 2/2] efi/libstub/x86: use mandatory 16-byte stack alignment in mixed mode Ard Biesheuvel

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='CAKv+Gu9bPdCB6=YhDNjPL-S3oWexeEf0wLDuvo-kr0HZ31Feeg@mail.gmail.com' \
    --to=ard.biesheuvel@linaro.org \
    --cc=ardb@kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=nivedita@alum.mit.edu \
    --cc=x86@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).