aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhu Guihua <zhugh.fnst@cn.fujitsu.com>2015-07-03 05:37:18 -0400
committerIngo Molnar <mingo@kernel.org>2015-07-06 09:00:33 -0400
commit1db875631f8d5bbf497f67e47f254eece888d51d (patch)
tree5a593314db2959c413e20695b6db1bfbef6a22ed
parentd6f2d75a7ae06ffd793bb504c4f0d1665548cffc (diff)
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: Zhu 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.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/include/asm/espfix.h2
-rw-r--r--arch/x86/kernel/espfix_64.c7
-rw-r--r--arch/x86/kernel/smpboot.c2
3 files changed, 5 insertions, 6 deletions
diff --git a/arch/x86/include/asm/espfix.h b/arch/x86/include/asm/espfix.h
index 99efebb2f69d..ca3ce9ab9385 100644
--- a/arch/x86/include/asm/espfix.h
+++ b/arch/x86/include/asm/espfix.h
@@ -9,7 +9,7 @@ DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_stack);
9DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_waddr); 9DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_waddr);
10 10
11extern void init_espfix_bsp(void); 11extern void init_espfix_bsp(void);
12extern void init_espfix_ap(void); 12extern void init_espfix_ap(int cpu);
13 13
14#endif /* CONFIG_X86_64 */ 14#endif /* CONFIG_X86_64 */
15 15
diff --git a/arch/x86/kernel/espfix_64.c b/arch/x86/kernel/espfix_64.c
index f5d0730e7b08..1fb0e0003c94 100644
--- a/arch/x86/kernel/espfix_64.c
+++ b/arch/x86/kernel/espfix_64.c
@@ -131,12 +131,12 @@ void __init init_espfix_bsp(void)
131 init_espfix_random(); 131 init_espfix_random();
132 132
133 /* The rest is the same as for any other processor */ 133 /* The rest is the same as for any other processor */
134 init_espfix_ap(); 134 init_espfix_ap(0);
135} 135}
136 136
137void init_espfix_ap(void) 137void init_espfix_ap(int cpu)
138{ 138{
139 unsigned int cpu, page; 139 unsigned int page;
140 unsigned long addr; 140 unsigned long addr;
141 pud_t pud, *pud_p; 141 pud_t pud, *pud_p;
142 pmd_t pmd, *pmd_p; 142 pmd_t pmd, *pmd_p;
@@ -149,7 +149,6 @@ void init_espfix_ap(void)
149 if (likely(this_cpu_read(espfix_stack))) 149 if (likely(this_cpu_read(espfix_stack)))
150 return; /* Already initialized */ 150 return; /* Already initialized */
151 151
152 cpu = smp_processor_id();
153 addr = espfix_base_addr(cpu); 152 addr = espfix_base_addr(cpu);
154 page = cpu/ESPFIX_STACKS_PER_PAGE; 153 page = cpu/ESPFIX_STACKS_PER_PAGE;
155 154
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 8add66b22f33..6f5abac6c28b 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -242,7 +242,7 @@ static void notrace start_secondary(void *unused)
242 * Enable the espfix hack for this CPU 242 * Enable the espfix hack for this CPU
243 */ 243 */
244#ifdef CONFIG_X86_ESPFIX64 244#ifdef CONFIG_X86_ESPFIX64
245 init_espfix_ap(); 245 init_espfix_ap(smp_processor_id());
246#endif 246#endif
247 247
248 /* 248 /*