Skip to contentSkip to conversation

efi: EFI_EARLYCON should depend on EFI

PATCH Applied Geert Uytterhoeven 4 participants 4 messages Nov 24, 2020 – Nov 27, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi: EFI_EARLYCON should depend on EFI

CONFIG_EFI_EARLYCON defaults to yes, and thus is enabled on systems that do not support EFI, or do not have EFI support enabled, but do satisfy the symbol's other dependencies.

While drivers/firmware/efi/ won't be entered during the build phase if CONFIG_EFI=n, and drivers/firmware/efi/earlycon.c itself thus won't be built, enabling EFI_EARLYCON does force-enable CONFIG_FONT_SUPPORT and CONFIG_ARCH_USE_MEMREMAP_PROT, and CONFIG_FONT_8x16, which is undesirable.

Fix this by making CONFIG_EFI_EARLYCON depend on CONFIG_EFI.

This reduces kernel size on headless systems by more than 4 KiB.

Fixes 69c1f396f25b805a ("efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation")
---
 drivers/firmware/efi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/Kconfig +1 -1
index b452cfa2100b401c..1dd1f7784f0888ff 100644
@@ -270,7 +270,7 @@ config EFI_DEV_PATH_PARSER
 
 config EFI_EARLYCON
 	def_bool y
-	depends on SERIAL_EARLYCON && !ARM && !IA64
+	depends on EFI && SERIAL_EARLYCON && !ARM && !IA64
 	select FONT_SUPPORT
 	select ARCH_USE_MEMREMAP_PROT
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 31 lines · Geert Uytterhoeven

CONFIG_EFI_EARLYCON defaults to yes, and thus is enabled on systems that do not support EFI, or do not have EFI support enabled, but do satisfy the symbol's other dependencies.

While drivers/firmware/efi/ won't be entered during the build phase if CONFIG_EFI=n, and drivers/firmware/efi/earlycon.c itself thus won't be built, enabling EFI_EARLYCON does force-enable CONFIG_FONT_SUPPORT and CONFIG_ARCH_USE_MEMREMAP_PROT, and CONFIG_FONT_8x16, which is undesirable.

Fix this by making CONFIG_EFI_EARLYCON depend on CONFIG_EFI.

This reduces kernel size on headless systems by more than 4 KiB.

Fixes 69c1f396f25b805a ("efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation")

---
 drivers/firmware/efi/Kconfig | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/Kconfig +0 -0
index b452cfa2100b401c..1dd1f7784f0888ff 100644
@@ -270,7 +270,7 @@ config EFI_DEV_PATH_PARSER

 config EFI_EARLYCON
  def_bool y

drivers/firmware/efi/Kconfig +1 -1
-	depends on SERIAL_EARLYCON && !ARM && !IA64
+	depends on EFI && SERIAL_EARLYCON && !ARM && !IA64
Quoted 4 lines

  select FONT_SUPPORT
  select ARCH_USE_MEMREMAP_PROT

Looks good to me.

Signature · 6 lines
Damien Le Moal
Western Digital
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
maintainer
#2 lore raw
Quoted 39 lines · Damien Le Moal
Quoted 27 lines · Geert Uytterhoeven

CONFIG_EFI_EARLYCON defaults to yes, and thus is enabled on systems that do not support EFI, or do not have EFI support enabled, but do satisfy the symbol's other dependencies.

While drivers/firmware/efi/ won't be entered during the build phase if CONFIG_EFI=n, and drivers/firmware/efi/earlycon.c itself thus won't be built, enabling EFI_EARLYCON does force-enable CONFIG_FONT_SUPPORT and CONFIG_ARCH_USE_MEMREMAP_PROT, and CONFIG_FONT_8x16, which is undesirable.

Fix this by making CONFIG_EFI_EARLYCON depend on CONFIG_EFI.

This reduces kernel size on headless systems by more than 4 KiB.

Fixes 69c1f396f25b805a ("efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation")
---
 drivers/firmware/efi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/Kconfig +0 -0
index b452cfa2100b401c..1dd1f7784f0888ff 100644

drivers/firmware/efi/Kconfig config EFI_DEV_PATH_PARSER · line 276

Quoted 8 lines
drivers/firmware/efi/Kconfig +1 -1
@@ -270,7 +270,7 @@ config EFI_DEV_PATH_PARSER
 
 
 config EFI_EARLYCON
      def_bool y
-     depends on SERIAL_EARLYCON && !ARM && !IA64
+     depends on EFI && SERIAL_EARLYCON && !ARM && !IA64
      select FONT_SUPPORT
      select ARCH_USE_MEMREMAP_PROT

Looks good to me.

Quoted 2 lines

Thanks all

I'll queue this as a fix.

#3 lore raw
In reply to Geert Uytterhoeven
The following commit has been merged into the efi/urgent branch of tip:

The following commit has been merged into the efi/urgent branch of tip:

Commit-ID:     36a237526cd81ff4b6829e6ebd60921c6f976e3b
Gitweb:        https://git.kernel.org/tip/36a237526cd81ff4b6829e6ebd60921c6f976e3b
Author:        Geert Uytterhoeven <[email protected]>
AuthorDate:    Tue, 24 Nov 2020 20:16:46 +01:00
Committer:     Ard Biesheuvel <[email protected]>
CommitterDate: Wed, 25 Nov 2020 16:55:02 +01:00

efi: EFI_EARLYCON should depend on EFI

CONFIG_EFI_EARLYCON defaults to yes, and thus is enabled on systems that do not support EFI, or do not have EFI support enabled, but do satisfy the symbol's other dependencies.

While drivers/firmware/efi/ won't be entered during the build phase if CONFIG_EFI=n, and drivers/firmware/efi/earlycon.c itself thus won't be built, enabling EFI_EARLYCON does force-enable CONFIG_FONT_SUPPORT and CONFIG_ARCH_USE_MEMREMAP_PROT, and CONFIG_FONT_8x16, which is undesirable.

Fix this by making CONFIG_EFI_EARLYCON depend on CONFIG_EFI.

This reduces kernel size on headless systems by more than 4 KiB.

Fixes 69c1f396f25b805a ("efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation")
---
 drivers/firmware/efi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/efi/Kconfig +1 -1
index 36ec1f7..d989549 100644
@@ -270,7 +270,7 @@ config EFI_DEV_PATH_PARSER
 
 config EFI_EARLYCON
 	def_bool y
-	depends on SERIAL_EARLYCON && !ARM && !IA64
+	depends on EFI && SERIAL_EARLYCON && !ARM && !IA64
 	select FONT_SUPPORT
 	select ARCH_USE_MEMREMAP_PROT