diff options
Diffstat (limited to 'arch/x86/kernel/trampoline.c')
-rw-r--r-- | arch/x86/kernel/trampoline.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/x86/kernel/trampoline.c b/arch/x86/kernel/trampoline.c index cd022121cab6..c652ef62742d 100644 --- a/arch/x86/kernel/trampoline.c +++ b/arch/x86/kernel/trampoline.c | |||
@@ -12,21 +12,19 @@ | |||
12 | #endif | 12 | #endif |
13 | 13 | ||
14 | /* ready for x86_64 and x86 */ | 14 | /* ready for x86_64 and x86 */ |
15 | unsigned char *__trampinitdata trampoline_base = __va(TRAMPOLINE_BASE); | 15 | unsigned char *__trampinitdata trampoline_base; |
16 | 16 | ||
17 | void __init reserve_trampoline_memory(void) | 17 | void __init reserve_trampoline_memory(void) |
18 | { | 18 | { |
19 | #ifdef CONFIG_X86_32 | 19 | unsigned long mem; |
20 | /* | 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. */ | 21 | /* Has to be in very low memory so we can execute real-mode AP code. */ |
28 | reserve_early(TRAMPOLINE_BASE, TRAMPOLINE_BASE + TRAMPOLINE_SIZE, | 22 | mem = find_e820_area(0, 1<<20, TRAMPOLINE_SIZE, PAGE_SIZE); |
29 | "TRAMPOLINE"); | 23 | if (mem == -1L) |
24 | panic("Cannot allocate trampoline\n"); | ||
25 | |||
26 | trampoline_base = __va(mem); | ||
27 | reserve_early(mem, mem + TRAMPOLINE_SIZE, "TRAMPOLINE"); | ||
30 | } | 28 | } |
31 | 29 | ||
32 | /* | 30 | /* |