espfix Use scaling addressing mode rather than shifting in PER_CPU
PATCH 1/1 espfix Use scaling addressing mode rather than shifting in PER_CPU
Use the x86 scaling addressing mode rather than shifting to multiplying by 4 in PER_CPU().
Signed-off-by Jeremy Fitzhardinge <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Stas Sergeev <[email protected]>
Cc Zachary Amsden <[email protected]>
Cc Chuck Ebbert <[email protected]>
Cc Jan Beulich <[email protected]>
Cc Andi Kleen <[email protected]>
include/asm-i386/percpu.h +0 -0
@@ -19,8 +19,7 @@*/
#ifdef CONFIG_SMP
#define PER_CPU(var, cpu) \
- shll $2, cpu; \
- movl __per_cpu_offset(cpu), cpu; \
+ movl __per_cpu_offset(,cpu,4), cpu; \ addl $per_cpu__/**/var, cpu;
#else /* ! SMP */
#define PER_CPU(var, cpu) \