All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
To: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Andreas Noever
	<andreas.noever-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Ard Biesheuvel
	<ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH 1/2] x86/efi: Optimize away setup_gop32/64 if unused
Date: Tue, 6 Sep 2016 08:10:09 +0200	[thread overview]
Message-ID: <20160906061009.GA27735@wunner.de> (raw)
In-Reply-To: <20160905123725.GF32579-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>

On Mon, Sep 05, 2016 at 01:37:25PM +0100, Matt Fleming wrote:
> On Mon, 22 Aug, at 12:01:21PM, Lukas Wunner wrote:
> > Eliminate the 64 bit code path when compiling for x86_32, and vice-versa
> > the 32 bit code path when compiling for x86_64 with mixed mode disabled.
> > 
> > Size of gop.o text section:
> > CONFIG_X86_32:                         1758 before, 1299 after
> > CONFIG_X86_64 && !CONFIG_EFI_MIXED:    2201 before, 1406 after
> > CONFIG_X86_64 &&  CONFIG_EFI_MIXED:    2201 before and after
> > 
> > Signed-off-by: Lukas Wunner <lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
> > Cc: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > ---
> >  arch/x86/include/asm/efi.h | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
> > index 6b06939..1bda245 100644
> > --- a/arch/x86/include/asm/efi.h
> > +++ b/arch/x86/include/asm/efi.h
> > @@ -207,14 +207,16 @@ struct efi_config {
> >  
> >  __pure const struct efi_config *__efi_early(void);
> >  
> > +#define efi_is_64bit()							\
> > +	(IS_ENABLED(CONFIG_X86_64) && (!IS_ENABLED(CONFIG_EFI_MIXED)	\
> > +				       || __efi_early()->is64))
> > +
> >  #define efi_call_early(f, ...)						\
> >  	__efi_early()->call(__efi_early()->f, __VA_ARGS__);
> >  
> >  #define __efi_call_early(f, ...)					\
> >  	__efi_early()->call((unsigned long)f, __VA_ARGS__);
> >  
> > -#define efi_is_64bit()		__efi_early()->is64
> > -
> >  extern bool efi_reboot_required(void);
> >  
> >  #else
> 
> Could you make this into a more readable static inline? e.g. something
> like this,
> 
> static inline bool efi_is_64bit(void)
> {
> 	if (!IS_ENABLED(CONFIG_X86_64))
> 		return false;
> 
> 	if (!IS_ENABLED(CONFIG_EFI_MIXED) || __efi_early()->is64)
> 		return true;
> 
> 	return false;
> }

Indeed this is much better. I've just sent out an updated version
in-reply-to the original patch.

Thanks a lot,

Lukas

WARNING: multiple messages have this Message-ID (diff)
From: Lukas Wunner <lukas@wunner.de>
To: Matt Fleming <matt@codeblueprint.co.uk>
Cc: linux-efi@vger.kernel.org,
	Andreas Noever <andreas.noever@gmail.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH 1/2] x86/efi: Optimize away setup_gop32/64 if unused
Date: Tue, 6 Sep 2016 08:10:09 +0200	[thread overview]
Message-ID: <20160906061009.GA27735@wunner.de> (raw)
In-Reply-To: <20160905123725.GF32579@codeblueprint.co.uk>

On Mon, Sep 05, 2016 at 01:37:25PM +0100, Matt Fleming wrote:
> On Mon, 22 Aug, at 12:01:21PM, Lukas Wunner wrote:
> > Eliminate the 64 bit code path when compiling for x86_32, and vice-versa
> > the 32 bit code path when compiling for x86_64 with mixed mode disabled.
> > 
> > Size of gop.o text section:
> > CONFIG_X86_32:                         1758 before, 1299 after
> > CONFIG_X86_64 && !CONFIG_EFI_MIXED:    2201 before, 1406 after
> > CONFIG_X86_64 &&  CONFIG_EFI_MIXED:    2201 before and after
> > 
> > Signed-off-by: Lukas Wunner <lukas@wunner.de>
> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > ---
> >  arch/x86/include/asm/efi.h | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
> > index 6b06939..1bda245 100644
> > --- a/arch/x86/include/asm/efi.h
> > +++ b/arch/x86/include/asm/efi.h
> > @@ -207,14 +207,16 @@ struct efi_config {
> >  
> >  __pure const struct efi_config *__efi_early(void);
> >  
> > +#define efi_is_64bit()							\
> > +	(IS_ENABLED(CONFIG_X86_64) && (!IS_ENABLED(CONFIG_EFI_MIXED)	\
> > +				       || __efi_early()->is64))
> > +
> >  #define efi_call_early(f, ...)						\
> >  	__efi_early()->call(__efi_early()->f, __VA_ARGS__);
> >  
> >  #define __efi_call_early(f, ...)					\
> >  	__efi_early()->call((unsigned long)f, __VA_ARGS__);
> >  
> > -#define efi_is_64bit()		__efi_early()->is64
> > -
> >  extern bool efi_reboot_required(void);
> >  
> >  #else
> 
> Could you make this into a more readable static inline? e.g. something
> like this,
> 
> static inline bool efi_is_64bit(void)
> {
> 	if (!IS_ENABLED(CONFIG_X86_64))
> 		return false;
> 
> 	if (!IS_ENABLED(CONFIG_EFI_MIXED) || __efi_early()->is64)
> 		return true;
> 
> 	return false;
> }

Indeed this is much better. I've just sent out an updated version
in-reply-to the original patch.

Thanks a lot,

Lukas

  parent reply	other threads:[~2016-09-06  6:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-22 10:01 [PATCH 1/2] x86/efi: Optimize away setup_gop32/64 if unused Lukas Wunner
2016-08-22 10:01 ` Lukas Wunner
     [not found] ` <188ea850c957034d482576dfdcf8c8a2536460cf.1471823100.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-08-22 10:01   ` [PATCH 2/2] x86/efi: Allow invocation of arbitrary boot services Lukas Wunner
2016-08-22 10:01     ` Lukas Wunner
2016-09-05 13:02     ` Matt Fleming
2016-09-05 12:37   ` [PATCH 1/2] x86/efi: Optimize away setup_gop32/64 if unused Matt Fleming
2016-09-05 12:37     ` Matt Fleming
     [not found]     ` <20160905123725.GF32579-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-09-06  6:10       ` Lukas Wunner [this message]
2016-09-06  6:10         ` Lukas Wunner
2016-09-06  6:05   ` [PATCH v2] " Lukas Wunner
2016-09-06  6:05     ` Lukas Wunner
     [not found]     ` <f80213780594fdb86b3c1f7256b459856ee953be.1473140971.git.lukas-JFq808J9C/izQB+pC5nmwQ@public.gmane.org>
2016-09-06  8:03       ` Ard Biesheuvel
2016-09-06 11:08       ` 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=20160906061009.GA27735@wunner.de \
    --to=lukas-jfq808j9c/izqb+pc5nmwq@public.gmane.org \
    --cc=andreas.noever-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org \
    --cc=x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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 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.