]> bbs.cooldavid.org Git - net-next-2.6.git/blame - arch/x86/kernel/trampoline.c
x86, AMD: Fix stale cpuid4_info shared_map data in shared_cpu_map cpumasks
[net-next-2.6.git] / arch / x86 / kernel / trampoline.c
CommitLineData
77ad386e
IM
1#include <linux/io.h>
2
3#include <asm/trampoline.h>
3e1e9002 4#include <asm/e820.h>
77ad386e 5
7a4b7e5e
JB
6#if defined(CONFIG_X86_64) && defined(CONFIG_ACPI_SLEEP)
7#define __trampinit
8#define __trampinitdata
9#else
10#define __trampinit __cpuinit
11#define __trampinitdata __cpuinitdata
12#endif
13
a4c81cf6 14/* ready for x86_64 and x86 */
7a4b7e5e 15unsigned char *__trampinitdata trampoline_base = __va(TRAMPOLINE_BASE);
77ad386e 16
3e1e9002
RW
17void __init reserve_trampoline_memory(void)
18{
19#ifdef CONFIG_X86_32
20 /*
21 * But first pinch a few for the stack/trampoline stuff
22 * FIXME: Don't need the extra page at 4K, but need to fix
23 * trampoline before removing it. (see the GDT stuff)
24 */
25 reserve_early(PAGE_SIZE, PAGE_SIZE + PAGE_SIZE, "EX TRAMPOLINE");
26#endif
27 /* Has to be in very low memory so we can execute real-mode AP code. */
28 reserve_early(TRAMPOLINE_BASE, TRAMPOLINE_BASE + TRAMPOLINE_SIZE,
29 "TRAMPOLINE");
30}
31
77ad386e
IM
32/*
33 * Currently trivial. Write the real->protected mode
34 * bootstrap into the page concerned. The caller
35 * has made sure it's suitably aligned.
36 */
7a4b7e5e 37unsigned long __trampinit setup_trampoline(void)
77ad386e 38{
3e1e9002 39 memcpy(trampoline_base, trampoline_data, TRAMPOLINE_SIZE);
77ad386e
IM
40 return virt_to_phys(trampoline_base);
41}