Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Zhu Guihua and committed by
Ingo Molnar
1db87563 d6f2d75a

+5 -6
+1 -1
arch/x86/include/asm/espfix.h
··· 9 9 DECLARE_PER_CPU_READ_MOSTLY(unsigned long, espfix_waddr); 10 10 11 11 extern void init_espfix_bsp(void); 12 - extern void init_espfix_ap(void); 12 + extern void init_espfix_ap(int cpu); 13 13 14 14 #endif /* CONFIG_X86_64 */ 15 15
+3 -4
arch/x86/kernel/espfix_64.c
··· 131 131 init_espfix_random(); 132 132 133 133 /* The rest is the same as for any other processor */ 134 - init_espfix_ap(); 134 + init_espfix_ap(0); 135 135 } 136 136 137 - void init_espfix_ap(void) 137 + void init_espfix_ap(int cpu) 138 138 { 139 - unsigned int cpu, page; 139 + unsigned int page; 140 140 unsigned long addr; 141 141 pud_t pud, *pud_p; 142 142 pmd_t pmd, *pmd_p; ··· 149 149 if (likely(this_cpu_read(espfix_stack))) 150 150 return; /* Already initialized */ 151 151 152 - cpu = smp_processor_id(); 153 152 addr = espfix_base_addr(cpu); 154 153 page = cpu/ESPFIX_STACKS_PER_PAGE; 155 154
+1 -1
arch/x86/kernel/smpboot.c
··· 242 242 * Enable the espfix hack for this CPU 243 243 */ 244 244 #ifdef CONFIG_X86_ESPFIX64 245 - init_espfix_ap(); 245 + init_espfix_ap(smp_processor_id()); 246 246 #endif 247 247 248 248 /*