Skip to contentSkip to conversation

x86: CONFIG_EFI should select CONFIG_RELOCATABLE

PATCH In review Matthew Garrett 3 participants 7 messages Jun 9, 2011 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: CONFIG_EFI should select CONFIG_RELOCATABLE

EFI doesn't provide any guarantees that any given address will be free, so the bootloader must have the freedom to position the kernel appropriately. Make CONFIG_EFI select CONFIG_RELOCATABLE in order to ensure that this constraint is satisfiable.

---
 arch/x86/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/Kconfig +1 -0
index da34972..580cd31 100644
@@ -1454,6 +1454,7 @@ config ARCH_USES_PG_UNCACHED
 config EFI
 	bool "EFI runtime service support"
 	depends on ACPI
+	select RELOCATABLE
 	---help---
 	  This enables the kernel to use EFI runtime services that are
 	  available (such as the EFI variable services).
Signature · 1 line
1.7.5.2
#1 lore raw
Quoted 6 lines · Matthew Garrett

EFI doesn't provide any guarantees that any given address will be free, so the bootloader must have the freedom to position the kernel appropriately. Make CONFIG_EFI select CONFIG_RELOCATABLE in order to ensure that this constraint is satisfiable.

Yeah, this is a requirement by the UEFI spec.

Quoted 16 lines
---
  arch/x86/Kconfig |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/Kconfig +1 -0
index da34972..580cd31 100644
@@ -1454,6 +1454,7 @@ config ARCH_USES_PG_UNCACHED
  config EFI
  	bool "EFI runtime service support"
  	depends on ACPI
+	select RELOCATABLE
  	---help---
  	  This enables the kernel to use EFI runtime services that are
  	  available (such as the EFI variable services).
Signature · 9 lines
        Peter

All parts should go together without forcing. You must remember that
the parts you are  reassembling were disassembled by you.  Therefore,
if you can't get them together again, there must be a reason. By all
means, do not use a hammer.
		-- IBM maintenance manual, 1925

01234567890123456789012345678901234567890123456789012345678901234567890123456789
#2 lore raw
In reply to Matthew Garrett
Quoted 15 lines · Matthew Garrett

EFI doesn't provide any guarantees that any given address will be free, so the bootloader must have the freedom to position the kernel appropriately. Make CONFIG_EFI select CONFIG_RELOCATABLE in order to ensure that this constraint is satisfiable.

---
 arch/x86/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/Kconfig +0 -0
index da34972..580cd31 100644

arch/x86/Kconfig config ARCH_USES_PG_UNCACHED · line 1460

Quoted 7 lines
arch/x86/Kconfig +1 -0
@@ -1454,6 +1454,7 @@ config ARCH_USES_PG_UNCACHED
 config EFI
 	bool "EFI runtime service support"
 	depends on ACPI
+	select RELOCATABLE
 	---help---
 	  This enables the kernel to use EFI runtime services that are
 	  available (such as the EFI variable services).

Can we make this a depends on instead of select?

-hpa

#3 lore raw
Quoted 11 lines · H. Peter Anvin
Quoted 10 lines · Matthew Garrett

EFI doesn't provide any guarantees that any given address will be free, so the bootloader must have the freedom to position the kernel appropriately. Make CONFIG_EFI select CONFIG_RELOCATABLE in order to ensure that this constraint is satisfiable.

---
  arch/x86/Kconfig |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
Quoted 14 lines

arch/x86/Kconfig config ARCH_USES_PG_UNCACHED · line 1460

Quoted 12 lines
arch/x86/Kconfig +1 -0
index da34972..580cd31 100644
@@ -1454,6 +1454,7 @@ config ARCH_USES_PG_UNCACHED
  config EFI
  	bool "EFI runtime service support"
  	depends on ACPI
+	select RELOCATABLE
  	---help---
  	  This enables the kernel to use EFI runtime services that are
  	  available (such as the EFI variable services).

Can we make this a depends on instead of select?

Seems weird to me - when you're configuring the kernel, you're more likely to know that you want EFI than to remember that that requires relocation.

Signature · 1 line
        Peter
#4 lore raw
Quoted 6 lines · Peter Jones
Quoted 2 lines

Can we make this a depends on instead of select?

Seems weird to me - when you're configuring the kernel, you're more likely to know that you want EFI than to remember that that requires relocation.

Yes, but "select" is handled very poorly by Kconfig.

-hpa

#5 lore raw
Quoted 9 lines · H. Peter Anvin
Quoted 6 lines · Peter Jones
Quoted 2 lines

Can we make this a depends on instead of select?

Seems weird to me - when you're configuring the kernel, you're more likely to know that you want EFI than to remember that that requires relocation.

Yes, but "select" is handled very poorly by Kconfig.

I think it's safe in this case.

Signature · 1 line
Matthew Garrett | [email protected]
#6 lore raw
In reply to H. Peter Anvin
Quoted 10 lines · H. Peter Anvin

arch/x86/Kconfig config ARCH_USES_PG_UNCACHED · line 1460

Quoted 7 lines · Matthew Garrett

config EFI

arch/x86/Kconfig +1 -0
 	bool "EFI runtime service support"
 	depends on ACPI
+	select RELOCATABLE
 	---help---
 	  This enables the kernel to use EFI runtime services that are
 	  available (such as the EFI variable services).

Can we make this a depends on instead of select?

CONFIG_RELOCATABLE has no dependencies so select should be safe, and depends means CONFIG_EFI vanishes until you turn on something that seems entirely unrelated. I've no problem with it being depends, but this seems friendlier.

Signature · 1 line
Matthew Garrett | [email protected]