diff options
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/compat.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/current.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/desc.h | 1 | ||||
-rw-r--r-- | arch/x86/include/asm/fpu-internal.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/hardirq.h | 9 | ||||
-rw-r--r-- | arch/x86/include/asm/irq_regs.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/mmu_context.h | 12 | ||||
-rw-r--r-- | arch/x86/include/asm/percpu.h | 8 | ||||
-rw-r--r-- | arch/x86/include/asm/smp.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/stackprotector.h | 4 | ||||
-rw-r--r-- | arch/x86/include/asm/thread_info.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/tlbflush.h | 4 |
12 files changed, 30 insertions, 28 deletions
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h index d6805798d6fc..fedf32b73e65 100644 --- a/arch/x86/include/asm/compat.h +++ b/arch/x86/include/asm/compat.h | |||
@@ -229,7 +229,7 @@ static inline void __user *arch_compat_alloc_user_space(long len) | |||
229 | sp = task_pt_regs(current)->sp; | 229 | sp = task_pt_regs(current)->sp; |
230 | } else { | 230 | } else { |
231 | /* -128 for the x32 ABI redzone */ | 231 | /* -128 for the x32 ABI redzone */ |
232 | sp = percpu_read(old_rsp) - 128; | 232 | sp = this_cpu_read(old_rsp) - 128; |
233 | } | 233 | } |
234 | 234 | ||
235 | return (void __user *)round_down(sp - len, 16); | 235 | return (void __user *)round_down(sp - len, 16); |
diff --git a/arch/x86/include/asm/current.h b/arch/x86/include/asm/current.h index 4d447b732d82..9476c04ee635 100644 --- a/arch/x86/include/asm/current.h +++ b/arch/x86/include/asm/current.h | |||
@@ -11,7 +11,7 @@ DECLARE_PER_CPU(struct task_struct *, current_task); | |||
11 | 11 | ||
12 | static __always_inline struct task_struct *get_current(void) | 12 | static __always_inline struct task_struct *get_current(void) |
13 | { | 13 | { |
14 | return percpu_read_stable(current_task); | 14 | return this_cpu_read_stable(current_task); |
15 | } | 15 | } |
16 | 16 | ||
17 | #define current get_current() | 17 | #define current get_current() |
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h index e95822d683f4..8bf1c06070d5 100644 --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <asm/mmu.h> | 6 | #include <asm/mmu.h> |
7 | 7 | ||
8 | #include <linux/smp.h> | 8 | #include <linux/smp.h> |
9 | #include <linux/percpu.h> | ||
9 | 10 | ||
10 | static inline void fill_ldt(struct desc_struct *desc, const struct user_desc *info) | 11 | static inline void fill_ldt(struct desc_struct *desc, const struct user_desc *info) |
11 | { | 12 | { |
diff --git a/arch/x86/include/asm/fpu-internal.h b/arch/x86/include/asm/fpu-internal.h index 4fa88154e4de..75f4c6d6a331 100644 --- a/arch/x86/include/asm/fpu-internal.h +++ b/arch/x86/include/asm/fpu-internal.h | |||
@@ -290,14 +290,14 @@ static inline int __thread_has_fpu(struct task_struct *tsk) | |||
290 | static inline void __thread_clear_has_fpu(struct task_struct *tsk) | 290 | static inline void __thread_clear_has_fpu(struct task_struct *tsk) |
291 | { | 291 | { |
292 | tsk->thread.fpu.has_fpu = 0; | 292 | tsk->thread.fpu.has_fpu = 0; |
293 | percpu_write(fpu_owner_task, NULL); | 293 | this_cpu_write(fpu_owner_task, NULL); |
294 | } | 294 | } |
295 | 295 | ||
296 | /* Must be paired with a 'clts' before! */ | 296 | /* Must be paired with a 'clts' before! */ |
297 | static inline void __thread_set_has_fpu(struct task_struct *tsk) | 297 | static inline void __thread_set_has_fpu(struct task_struct *tsk) |
298 | { | 298 | { |
299 | tsk->thread.fpu.has_fpu = 1; | 299 | tsk->thread.fpu.has_fpu = 1; |
300 | percpu_write(fpu_owner_task, tsk); | 300 | this_cpu_write(fpu_owner_task, tsk); |
301 | } | 301 | } |
302 | 302 | ||
303 | /* | 303 | /* |
@@ -344,7 +344,7 @@ typedef struct { int preload; } fpu_switch_t; | |||
344 | */ | 344 | */ |
345 | static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu) | 345 | static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu) |
346 | { | 346 | { |
347 | return new == percpu_read_stable(fpu_owner_task) && | 347 | return new == this_cpu_read_stable(fpu_owner_task) && |
348 | cpu == new->thread.fpu.last_cpu; | 348 | cpu == new->thread.fpu.last_cpu; |
349 | } | 349 | } |
350 | 350 | ||
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index 382f75d735f3..d3895dbf4ddb 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h | |||
@@ -35,14 +35,15 @@ DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); | |||
35 | 35 | ||
36 | #define __ARCH_IRQ_STAT | 36 | #define __ARCH_IRQ_STAT |
37 | 37 | ||
38 | #define inc_irq_stat(member) percpu_inc(irq_stat.member) | 38 | #define inc_irq_stat(member) this_cpu_inc(irq_stat.member) |
39 | 39 | ||
40 | #define local_softirq_pending() percpu_read(irq_stat.__softirq_pending) | 40 | #define local_softirq_pending() this_cpu_read(irq_stat.__softirq_pending) |
41 | 41 | ||
42 | #define __ARCH_SET_SOFTIRQ_PENDING | 42 | #define __ARCH_SET_SOFTIRQ_PENDING |
43 | 43 | ||
44 | #define set_softirq_pending(x) percpu_write(irq_stat.__softirq_pending, (x)) | 44 | #define set_softirq_pending(x) \ |
45 | #define or_softirq_pending(x) percpu_or(irq_stat.__softirq_pending, (x)) | 45 | this_cpu_write(irq_stat.__softirq_pending, (x)) |
46 | #define or_softirq_pending(x) this_cpu_or(irq_stat.__softirq_pending, (x)) | ||
46 | 47 | ||
47 | extern void ack_bad_irq(unsigned int irq); | 48 | extern void ack_bad_irq(unsigned int irq); |
48 | 49 | ||
diff --git a/arch/x86/include/asm/irq_regs.h b/arch/x86/include/asm/irq_regs.h index 77843225b7ea..d82250b1debb 100644 --- a/arch/x86/include/asm/irq_regs.h +++ b/arch/x86/include/asm/irq_regs.h | |||
@@ -15,7 +15,7 @@ DECLARE_PER_CPU(struct pt_regs *, irq_regs); | |||
15 | 15 | ||
16 | static inline struct pt_regs *get_irq_regs(void) | 16 | static inline struct pt_regs *get_irq_regs(void) |
17 | { | 17 | { |
18 | return percpu_read(irq_regs); | 18 | return this_cpu_read(irq_regs); |
19 | } | 19 | } |
20 | 20 | ||
21 | static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) | 21 | static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) |
@@ -23,7 +23,7 @@ static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) | |||
23 | struct pt_regs *old_regs; | 23 | struct pt_regs *old_regs; |
24 | 24 | ||
25 | old_regs = get_irq_regs(); | 25 | old_regs = get_irq_regs(); |
26 | percpu_write(irq_regs, new_regs); | 26 | this_cpu_write(irq_regs, new_regs); |
27 | 27 | ||
28 | return old_regs; | 28 | return old_regs; |
29 | } | 29 | } |
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h index 69021528b43c..cdbf36776106 100644 --- a/arch/x86/include/asm/mmu_context.h +++ b/arch/x86/include/asm/mmu_context.h | |||
@@ -25,8 +25,8 @@ void destroy_context(struct mm_struct *mm); | |||
25 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) | 25 | static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) |
26 | { | 26 | { |
27 | #ifdef CONFIG_SMP | 27 | #ifdef CONFIG_SMP |
28 | if (percpu_read(cpu_tlbstate.state) == TLBSTATE_OK) | 28 | if (this_cpu_read(cpu_tlbstate.state) == TLBSTATE_OK) |
29 | percpu_write(cpu_tlbstate.state, TLBSTATE_LAZY); | 29 | this_cpu_write(cpu_tlbstate.state, TLBSTATE_LAZY); |
30 | #endif | 30 | #endif |
31 | } | 31 | } |
32 | 32 | ||
@@ -37,8 +37,8 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
37 | 37 | ||
38 | if (likely(prev != next)) { | 38 | if (likely(prev != next)) { |
39 | #ifdef CONFIG_SMP | 39 | #ifdef CONFIG_SMP |
40 | percpu_write(cpu_tlbstate.state, TLBSTATE_OK); | 40 | this_cpu_write(cpu_tlbstate.state, TLBSTATE_OK); |
41 | percpu_write(cpu_tlbstate.active_mm, next); | 41 | this_cpu_write(cpu_tlbstate.active_mm, next); |
42 | #endif | 42 | #endif |
43 | cpumask_set_cpu(cpu, mm_cpumask(next)); | 43 | cpumask_set_cpu(cpu, mm_cpumask(next)); |
44 | 44 | ||
@@ -56,8 +56,8 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
56 | } | 56 | } |
57 | #ifdef CONFIG_SMP | 57 | #ifdef CONFIG_SMP |
58 | else { | 58 | else { |
59 | percpu_write(cpu_tlbstate.state, TLBSTATE_OK); | 59 | this_cpu_write(cpu_tlbstate.state, TLBSTATE_OK); |
60 | BUG_ON(percpu_read(cpu_tlbstate.active_mm) != next); | 60 | BUG_ON(this_cpu_read(cpu_tlbstate.active_mm) != next); |
61 | 61 | ||
62 | if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next))) { | 62 | if (!cpumask_test_and_set_cpu(cpu, mm_cpumask(next))) { |
63 | /* We were in lazy tlb mode and leave_mm disabled | 63 | /* We were in lazy tlb mode and leave_mm disabled |
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h index 7a11910a63c4..967ee3be5c0a 100644 --- a/arch/x86/include/asm/percpu.h +++ b/arch/x86/include/asm/percpu.h | |||
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | #ifdef CONFIG_SMP | 47 | #ifdef CONFIG_SMP |
48 | #define __percpu_prefix "%%"__stringify(__percpu_seg)":" | 48 | #define __percpu_prefix "%%"__stringify(__percpu_seg)":" |
49 | #define __my_cpu_offset percpu_read(this_cpu_off) | 49 | #define __my_cpu_offset this_cpu_read(this_cpu_off) |
50 | 50 | ||
51 | /* | 51 | /* |
52 | * Compared to the generic __my_cpu_offset version, the following | 52 | * Compared to the generic __my_cpu_offset version, the following |
@@ -352,15 +352,15 @@ do { \ | |||
352 | 352 | ||
353 | /* | 353 | /* |
354 | * percpu_read() makes gcc load the percpu variable every time it is | 354 | * percpu_read() makes gcc load the percpu variable every time it is |
355 | * accessed while percpu_read_stable() allows the value to be cached. | 355 | * accessed while this_cpu_read_stable() allows the value to be cached. |
356 | * percpu_read_stable() is more efficient and can be used if its value | 356 | * this_cpu_read_stable() is more efficient and can be used if its value |
357 | * is guaranteed to be valid across cpus. The current users include | 357 | * is guaranteed to be valid across cpus. The current users include |
358 | * get_current() and get_thread_info() both of which are actually | 358 | * get_current() and get_thread_info() both of which are actually |
359 | * per-thread variables implemented as per-cpu variables and thus | 359 | * per-thread variables implemented as per-cpu variables and thus |
360 | * stable for the duration of the respective task. | 360 | * stable for the duration of the respective task. |
361 | */ | 361 | */ |
362 | #define percpu_read(var) percpu_from_op("mov", var, "m" (var)) | 362 | #define percpu_read(var) percpu_from_op("mov", var, "m" (var)) |
363 | #define percpu_read_stable(var) percpu_from_op("mov", var, "p" (&(var))) | 363 | #define this_cpu_read_stable(var) percpu_from_op("mov", var, "p" (&(var))) |
364 | #define percpu_write(var, val) percpu_to_op("mov", var, val) | 364 | #define percpu_write(var, val) percpu_to_op("mov", var, val) |
365 | #define percpu_add(var, val) percpu_add_op(var, val) | 365 | #define percpu_add(var, val) percpu_add_op(var, val) |
366 | #define percpu_sub(var, val) percpu_add_op(var, -(val)) | 366 | #define percpu_sub(var, val) percpu_add_op(var, -(val)) |
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h index 0434c400287c..e276f6bb6524 100644 --- a/arch/x86/include/asm/smp.h +++ b/arch/x86/include/asm/smp.h | |||
@@ -188,11 +188,11 @@ extern unsigned disabled_cpus __cpuinitdata; | |||
188 | * from the initial startup. We map APIC_BASE very early in page_setup(), | 188 | * from the initial startup. We map APIC_BASE very early in page_setup(), |
189 | * so this is correct in the x86 case. | 189 | * so this is correct in the x86 case. |
190 | */ | 190 | */ |
191 | #define raw_smp_processor_id() (percpu_read(cpu_number)) | 191 | #define raw_smp_processor_id() (this_cpu_read(cpu_number)) |
192 | extern int safe_smp_processor_id(void); | 192 | extern int safe_smp_processor_id(void); |
193 | 193 | ||
194 | #elif defined(CONFIG_X86_64_SMP) | 194 | #elif defined(CONFIG_X86_64_SMP) |
195 | #define raw_smp_processor_id() (percpu_read(cpu_number)) | 195 | #define raw_smp_processor_id() (this_cpu_read(cpu_number)) |
196 | 196 | ||
197 | #define stack_smp_processor_id() \ | 197 | #define stack_smp_processor_id() \ |
198 | ({ \ | 198 | ({ \ |
diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h index b5d9533d2c38..6a998598f172 100644 --- a/arch/x86/include/asm/stackprotector.h +++ b/arch/x86/include/asm/stackprotector.h | |||
@@ -75,9 +75,9 @@ static __always_inline void boot_init_stack_canary(void) | |||
75 | 75 | ||
76 | current->stack_canary = canary; | 76 | current->stack_canary = canary; |
77 | #ifdef CONFIG_X86_64 | 77 | #ifdef CONFIG_X86_64 |
78 | percpu_write(irq_stack_union.stack_canary, canary); | 78 | this_cpu_write(irq_stack_union.stack_canary, canary); |
79 | #else | 79 | #else |
80 | percpu_write(stack_canary.canary, canary); | 80 | this_cpu_write(stack_canary.canary, canary); |
81 | #endif | 81 | #endif |
82 | } | 82 | } |
83 | 83 | ||
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index ad6df8ccd715..f67fd89c874b 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h | |||
@@ -222,7 +222,7 @@ DECLARE_PER_CPU(unsigned long, kernel_stack); | |||
222 | static inline struct thread_info *current_thread_info(void) | 222 | static inline struct thread_info *current_thread_info(void) |
223 | { | 223 | { |
224 | struct thread_info *ti; | 224 | struct thread_info *ti; |
225 | ti = (void *)(percpu_read_stable(kernel_stack) + | 225 | ti = (void *)(this_cpu_read_stable(kernel_stack) + |
226 | KERNEL_STACK_OFFSET - THREAD_SIZE); | 226 | KERNEL_STACK_OFFSET - THREAD_SIZE); |
227 | return ti; | 227 | return ti; |
228 | } | 228 | } |
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h index c0e108e08079..1620d23f14d7 100644 --- a/arch/x86/include/asm/tlbflush.h +++ b/arch/x86/include/asm/tlbflush.h | |||
@@ -156,8 +156,8 @@ DECLARE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate); | |||
156 | 156 | ||
157 | static inline void reset_lazy_tlbstate(void) | 157 | static inline void reset_lazy_tlbstate(void) |
158 | { | 158 | { |
159 | percpu_write(cpu_tlbstate.state, 0); | 159 | this_cpu_write(cpu_tlbstate.state, 0); |
160 | percpu_write(cpu_tlbstate.active_mm, &init_mm); | 160 | this_cpu_write(cpu_tlbstate.active_mm, &init_mm); |
161 | } | 161 | } |
162 | 162 | ||
163 | #endif /* SMP */ | 163 | #endif /* SMP */ |