From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754626AbcIFGKH (ORCPT ); Tue, 6 Sep 2016 02:10:07 -0400 Received: from mailout1.hostsharing.net ([83.223.95.204]:36309 "EHLO mailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752380AbcIFGKE (ORCPT ); Tue, 6 Sep 2016 02:10:04 -0400 Date: Tue, 6 Sep 2016 08:10:09 +0200 From: Lukas Wunner To: Matt Fleming Cc: linux-efi@vger.kernel.org, Andreas Noever , Ard Biesheuvel , linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH 1/2] x86/efi: Optimize away setup_gop32/64 if unused Message-ID: <20160906061009.GA27735@wunner.de> References: <188ea850c957034d482576dfdcf8c8a2536460cf.1471823100.git.lukas@wunner.de> <20160905123725.GF32579@codeblueprint.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160905123725.GF32579@codeblueprint.co.uk> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > > Cc: Ard Biesheuvel > > --- > > 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