Skip to contentSkip to conversation

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

PATCH In review Jarkko Sakkinen 2 participants 3 messages Oct 15, 2014 – 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.

---
 arch/x86/realmode/rm/Makefile | 4 ++++
 1 file changed, 4 insertions(+)
arch/x86/realmode/rm/Makefile +4 -0
index 7c0d7be..82b7312 100644
@@ -20,7 +20,11 @@ wakeup-objs	+= video-vesa.o
 wakeup-objs	+= video-bios.o
 
 realmode-y			+= header.o
+ifdef CONFIG_X86_64
 realmode-y			+= trampoline_$(BITS).o
+else
+realmode-$(CONFIG_SMP)		+= trampoline_$(BITS).o
+endif
 realmode-y			+= stack.o
 realmode-y			+= reboot.o
 realmode-$(CONFIG_ACPI_SLEEP)	+= $(wakeup-objs)
Signature · 1 line
2.1.0
#1 lore raw
Quoted 15 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.

---
 arch/x86/realmode/rm/Makefile | 4 ++++
 1 file changed, 4 insertions(+)
arch/x86/realmode/rm/Makefile +0 -0
index 7c0d7be..82b7312 100644
@@ -20,7 +20,11 @@ wakeup-objs	+= video-vesa.o
 wakeup-objs	+= video-bios.o

arch/x86/realmode/rm/Makefile wakeup-objs += video-vesa.o · line 30

Quoted 10 lines
arch/x86/realmode/rm/Makefile +4 -0
 
 realmode-y			+= header.o
+ifdef CONFIG_X86_64
 realmode-y			+= trampoline_$(BITS).o
+else
+realmode-$(CONFIG_SMP)		+= trampoline_$(BITS).o
+endif
 realmode-y			+= stack.o
 realmode-y			+= reboot.o
 realmode-$(CONFIG_ACPI_SLEEP)	+= $(wakeup-objs)

It is usually preferred to make this a hidden config option (e.g. CONFIG_X86_TRAMPOLINE) rather than use ifdef, especially since your ifdef has another conditional inside it.

-hpa

#2 lore raw
Quoted 16 lines · H. Peter Anvin
Quoted 15 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.

---
 arch/x86/realmode/rm/Makefile | 4 ++++
 1 file changed, 4 insertions(+)
arch/x86/realmode/rm/Makefile +0 -0
index 7c0d7be..82b7312 100644
@@ -20,7 +20,11 @@ wakeup-objs	+= video-vesa.o
 wakeup-objs	+= video-bios.o
 
Quoted 14 lines

arch/x86/realmode/rm/Makefile wakeup-objs += video-vesa.o · line 30

Quoted 10 lines
arch/x86/realmode/rm/Makefile +4 -0
 realmode-y			+= header.o
+ifdef CONFIG_X86_64
 realmode-y			+= trampoline_$(BITS).o
+else
+realmode-$(CONFIG_SMP)		+= trampoline_$(BITS).o
+endif
 realmode-y			+= stack.o
 realmode-y			+= reboot.o
 realmode-$(CONFIG_ACPI_SLEEP)	+= $(wakeup-objs)

It is usually preferred to make this a hidden config option (e.g. CONFIG_X86_TRAMPOLINE) rather than use ifdef, especially since your ifdef has another conditional inside it.

OK, I'll revise the patch, thanks.

Quoted 1 line

-hpa

/Jarkko