Commit 1db87563 authored by Zhu Guihua's avatar Zhu Guihua Committed by Ingo Molnar

x86/espfix: Add 'cpu' parameter to init_espfix_ap()

Add a CPU index parameter to init_espfix_ap(), so that the
parameter could be propagated to the function for espfix
page allocation.
Signed-off-by: default avatarZhu Guihua <zhugh.fnst@cn.fujitsu.com>
Cc: <bp@alien8.de>
Cc: <luto@amacapital.net>
Cc: <luto@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/cde3fcf1b3211f3f03feb1a995bce3fee850f0fc.1435824469.git.zhugh.fnst@cn.fujitsu.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent d6f2d75a
...@@ -9,7 +9,7 @@ DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack); ...@@ -9,7 +9,7 @@ DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack);
DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_waddr); DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_waddr);
extern void init_espfix_bsp(void); extern void init_espfix_bsp(void);
extern void init_espfix_ap(void); extern void init_espfix_ap(int cpu);
#endif /* CONFIG_X86_64 */ #endif /* CONFIG_X86_64 */
......
...@@ -131,12 +131,12 @@ void __init init_espfix_bsp(void) ...@@ -131,12 +131,12 @@ void __init init_espfix_bsp(void)
init_espfix_random(); init_espfix_random();
/* The rest is the same as for any other processor */ /* The rest is the same as for any other processor */
init_espfix_ap(); init_espfix_ap(0);
} }
void init_espfix_ap(void) void init_espfix_ap(int cpu)
{ {
unsigned int cpu, page; unsigned int page;
unsigned long addr; unsigned long addr;
pud_t pud, *pud_p; pud_t pud, *pud_p;
pmd_t pmd, *pmd_p; pmd_t pmd, *pmd_p;
...@@ -149,7 +149,6 @@ void init_espfix_ap(void) ...@@ -149,7 +149,6 @@ void init_espfix_ap(void)
if (likely(this_cpu_read(espfix_stack))) if (likely(this_cpu_read(espfix_stack)))
return; /* Already initialized */ return; /* Already initialized */
cpu = smp_processor_id();
addr = espfix_base_addr(cpu); addr = espfix_base_addr(cpu);
page = cpu/ESPFIX_STACKS_PER_PAGE; page = cpu/ESPFIX_STACKS_PER_PAGE;
......
...@@ -242,7 +242,7 @@ static void notrace start_secondary(void *unused) ...@@ -242,7 +242,7 @@ static void notrace start_secondary(void *unused)
* Enable the espfix hack for this CPU * Enable the espfix hack for this CPU
*/ */
#ifdef CONFIG_X86_ESPFIX64 #ifdef CONFIG_X86_ESPFIX64
init_espfix_ap(); init_espfix_ap(smp_processor_id());
#endif #endif
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment