Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4822b7fc authored by H. Peter Anvin's avatar H. Peter Anvin
Browse files

x86, trampoline: Common infrastructure for low memory trampolines



Common infrastructure for low memory trampolines.  This code installs
the trampolines permanently in low memory very early.  It also permits
multiple pieces of code to be used for this purpose.

This code also introduces a standard infrastructure for computing
symbol addresses in the trampoline code.

The only change to the actual SMP trampolines themselves is that the
64-bit trampoline has been made reusable -- the previous version would
overwrite the code with a status variable; this moves the status
variable to a separate location.

Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
LKML-Reference: <4D5DFBE4.7090104@intel.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Matthieu Castet <castet.matthieu@free.fr>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
parent 85e2efbb
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -217,10 +217,6 @@ config X86_HT
	def_bool y
	depends on SMP

config X86_TRAMPOLINE
	def_bool y
	depends on SMP || (64BIT && ACPI_SLEEP)

config X86_32_LAZY_GS
	def_bool y
	depends on X86_32 && !CC_STACKPROTECTOR
+1 −2
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ obj-y += tsc.o io_delay.o rtc.o
obj-y			+= pci-iommu_table.o
obj-y			+= resource.o

obj-$(CONFIG_X86_TRAMPOLINE)	+= trampoline.o
obj-y				+= trampoline.o trampoline_$(BITS).o
obj-y				+= process.o
obj-y				+= i387.o xsave.o
obj-y				+= ptrace.o
@@ -69,7 +69,6 @@ obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_SMP)		+= smpboot.o tsc_sync.o
obj-$(CONFIG_SMP)		+= setup_percpu.o
obj-$(CONFIG_X86_64_SMP)	+= tsc_sync.o
obj-$(CONFIG_X86_TRAMPOLINE)	+= trampoline_$(BITS).o
obj-$(CONFIG_X86_MPPARSE)	+= mpparse.o
obj-y				+= apic/
obj-$(CONFIG_X86_REBOOTFIXUPS)	+= reboot_fixups_32.o
+0 −9
Original line number Diff line number Diff line
@@ -34,15 +34,6 @@ void __init i386_start_kernel(void)
{
	memblock_init();

#ifdef CONFIG_X86_TRAMPOLINE
	/*
	 * But first pinch a few for the stack/trampoline stuff
	 * FIXME: Don't need the extra page at 4K, but need to fix
	 * trampoline before removing it. (see the GDT stuff)
	 */
	memblock_x86_reserve_range(PAGE_SIZE, PAGE_SIZE + PAGE_SIZE, "EX TRAMPOLINE");
#endif

	memblock_x86_reserve_range(__pa_symbol(&_text), __pa_symbol(&__bss_stop), "TEXT DATA BSS");

#ifdef CONFIG_BLK_DEV_INITRD
+1 −2
Original line number Diff line number Diff line
@@ -136,10 +136,9 @@ ident_complete:
	/* Fixup phys_base */
	addq	%rbp, phys_base(%rip)

#ifdef CONFIG_X86_TRAMPOLINE
	/* Fixup trampoline */
	addq	%rbp, trampoline_level4_pgt + 0(%rip)
	addq	%rbp, trampoline_level4_pgt + (511*8)(%rip)
#endif

	/* Due to ENTRY(), sometimes the empty space gets filled with
	 * zeros. Better take a jmp than relying on empty space being
+1 −1
Original line number Diff line number Diff line
@@ -935,7 +935,7 @@ void __init setup_arch(char **cmdline_p)
	printk(KERN_DEBUG "initial memory mapped : 0 - %08lx\n",
			max_pfn_mapped<<PAGE_SHIFT);

	reserve_trampoline_memory();
	setup_trampolines();

#ifdef CONFIG_ACPI_SLEEP
	/*
Loading