From ff4726133709c7925a3996422c1ea27d6bb4ef25 Mon Sep 17 00:00:00 2001 From: "bgerofi@riken.jp" Date: Mon, 18 Aug 2014 21:56:45 +0900 Subject: [PATCH] receive trampoline addr via parameter of arch_start() --- arch/x86/kernel/cpu.c | 6 +++--- arch/x86/kernel/include/arch-memory.h | 3 ++- arch/x86/kernel/memory.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu.c b/arch/x86/kernel/cpu.c index ba030e51..372555f9 100644 --- a/arch/x86/kernel/cpu.c +++ b/arch/x86/kernel/cpu.c @@ -266,8 +266,8 @@ void ihk_mc_init_ap(void) { struct ihk_mc_cpu_info *cpu_info = ihk_mc_get_cpu_info(); - trampoline_va = map_fixed_area(AP_TRAMPOLINE, AP_TRAMPOLINE_SIZE, - 0); + trampoline_va = map_fixed_area(ap_trampoline, AP_TRAMPOLINE_SIZE, 0); + kprintf("trampoline area: 0x%lx \n", ap_trampoline); first_page_va = map_fixed_area(0, PAGE_SIZE, 0); kprintf("# of cpus : %d\n", cpu_info->ncpus); @@ -607,7 +607,7 @@ void ihk_mc_boot_cpu(int cpuid, unsigned long pc) cpu_boot_status = 0; - __x86_wakeup(cpuid, AP_TRAMPOLINE); + __x86_wakeup(cpuid, ap_trampoline); /* XXX: Time out */ while (!cpu_boot_status) { diff --git a/arch/x86/kernel/include/arch-memory.h b/arch/x86/kernel/include/arch-memory.h index e01a4cac..f49deedd 100644 --- a/arch/x86/kernel/include/arch-memory.h +++ b/arch/x86/kernel/include/arch-memory.h @@ -246,7 +246,8 @@ void flush_tlb_single(unsigned long addr); void *map_fixed_area(unsigned long phys, unsigned long size, int uncachable); -#define AP_TRAMPOLINE 0x10000 +extern unsigned long ap_trampoline; +//#define AP_TRAMPOLINE 0x10000 #define AP_TRAMPOLINE_SIZE 0x4000 /* Local is cachable */ diff --git a/arch/x86/kernel/memory.c b/arch/x86/kernel/memory.c index 25e772e7..ba7d737e 100644 --- a/arch/x86/kernel/memory.c +++ b/arch/x86/kernel/memory.c @@ -2088,7 +2088,7 @@ void ihk_mc_reserve_arch_pages(unsigned long start, unsigned long end, /* Reserve Text + temporal heap */ cb(virt_to_phys(_head), virt_to_phys(get_last_early_heap()), 0); /* Reserve trampoline area to boot the second ap */ - cb(AP_TRAMPOLINE, AP_TRAMPOLINE + AP_TRAMPOLINE_SIZE, 0); + cb(ap_trampoline, ap_trampoline + AP_TRAMPOLINE_SIZE, 0); /* Reserve the null page */ cb(0, PAGE_SIZE, 0); /* Micro-arch specific */