Re: [PATCH 1/2] efi/libstub/x86: use const attribute for efi_is_64bit()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 8 Jan 2020 at 16:23, Arvind Sankar <nivedita@xxxxxxxxxxxx> 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@xxxxxxxxxx>
> > ---
> >  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



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux