linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] x86/efi: Optimize away setup_gop32/64 if unused
@ 2016-08-22 10:01 Lukas Wunner
  2016-08-22 10:01 ` [PATCH 2/2] x86/efi: Allow invocation of arbitrary boot services Lukas Wunner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lukas Wunner @ 2016-08-22 10:01 UTC (permalink / raw)
  To: linux-efi, Matt Fleming; +Cc: Andreas Noever, Ard Biesheuvel, linux-kernel, x86

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
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-06  6:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-22 10:01 [PATCH 1/2] x86/efi: Optimize away setup_gop32/64 if unused Lukas Wunner
2016-08-22 10:01 ` [PATCH 2/2] x86/efi: Allow invocation of arbitrary boot services 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-06  6:10   ` Lukas Wunner
2016-09-06  6:05 ` [PATCH v2] " Lukas Wunner

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).