Skip to contentSkip to conversation

arch/x86/realmode: make trampoline code conditional for x86-32

PATCH In review Jarkko Sakkinen 1 participant 2 messages Oct 16, 2014 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/x86/realmode: make trampoline code conditional for x86-32

Trampoline code is only needed for SMP and in x86-64 for wakeup code. Make it conditional in order to minimize the kernel size. Added a new hidden config option CONFIG_X86_TRAMPOLINE as suggested by H. Peter Anvin.

The justification for this patch is tinyfication effort run by Josh Triplett. In embedded world a 32-bit processor without SMP is not uncommon phenomenon.

I think the trampoline code could be completely ripped off if ACPI_SLEEP and INTEL_TXT are not enabled but did not want to include that yet into this patch.

---
 arch/x86/Kconfig              |  4 ++++
 arch/x86/realmode/rm/Makefile | 10 +++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)
arch/x86/Kconfig +4 -0
index f2327e8..9603ca3 100644
@@ -2488,6 +2488,10 @@ config PMC_ATOM
 	def_bool y
         depends on PCI
 
+config X86_TRAMPOLINE
+	def_bool y
+	depends on X86_64 || SMP
+
 source "net/Kconfig"
 
 source "drivers/Kconfig"
arch/x86/realmode/rm/Makefile +5 -5
index 7c0d7be..299e450 100644
@@ -19,11 +19,11 @@ wakeup-objs	+= video-vga.o
 wakeup-objs	+= video-vesa.o
 wakeup-objs	+= video-bios.o
 
-realmode-y			+= header.o
-realmode-y			+= trampoline_$(BITS).o
-realmode-y			+= stack.o
-realmode-y			+= reboot.o
-realmode-$(CONFIG_ACPI_SLEEP)	+= $(wakeup-objs)
+realmode-y				+= header.o
+realmode-$(CONFIG_X86_TRAMPOLINE)	+= trampoline_$(BITS).o
+realmode-y				+= stack.o
+realmode-y				+= reboot.o
+realmode-$(CONFIG_ACPI_SLEEP)		+= $(wakeup-objs)
 
 targets	+= $(realmode-y)
 
Signature · 1 line
2.1.0
#1 lore raw
Quoted 24 lines · Jarkko Sakkinen

Trampoline code is only needed for SMP and in x86-64 for wakeup code. Make it conditional in order to minimize the kernel size. Added a new hidden config option CONFIG_X86_TRAMPOLINE as suggested by H. Peter Anvin.

The justification for this patch is tinyfication effort run by Josh Triplett. In embedded world a 32-bit processor without SMP is not uncommon phenomenon.

I think the trampoline code could be completely ripped off if ACPI_SLEEP and INTEL_TXT are not enabled but did not want to include that yet into this patch.

---
 arch/x86/Kconfig              |  4 ++++
 arch/x86/realmode/rm/Makefile | 10 +++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)
arch/x86/Kconfig +0 -0
index f2327e8..9603ca3 100644

arch/x86/Kconfig config PMC_ATOM · line 2493

Quoted 6 lines
arch/x86/Kconfig +3 -0
@@ -2488,6 +2488,10 @@ config PMC_ATOM
 	def_bool y
         depends on PCI
 
+config X86_TRAMPOLINE
+	def_bool y
+	depends on X86_64 || SMP

I think this could be just as well

  depends on (X86_64 && (INTEL_TXT || ACPI_SLEEP)) || SMP

Should I send an updated patch?

Quoted 28 lines
arch/x86/Kconfig +1 -0
+
 source "net/Kconfig"
 
 source "drivers/Kconfig"
arch/x86/realmode/rm/Makefile +5 -5
index 7c0d7be..299e450 100644
@@ -19,11 +19,11 @@ wakeup-objs	+= video-vga.o
 wakeup-objs	+= video-vesa.o
 wakeup-objs	+= video-bios.o
 
-realmode-y			+= header.o
-realmode-y			+= trampoline_$(BITS).o
-realmode-y			+= stack.o
-realmode-y			+= reboot.o
-realmode-$(CONFIG_ACPI_SLEEP)	+= $(wakeup-objs)
+realmode-y				+= header.o
+realmode-$(CONFIG_X86_TRAMPOLINE)	+= trampoline_$(BITS).o
+realmode-y				+= stack.o
+realmode-y				+= reboot.o
+realmode-$(CONFIG_ACPI_SLEEP)		+= $(wakeup-objs)
 
 targets	+= $(realmode-y)
 
Signature · 1 line
2.1.0

/Jarkko