diff options
-rw-r--r-- | arch/x86/include/asm/processor.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c | 2 | ||||
-rw-r--r-- | include/asm-generic/percpu.h | 3 | ||||
-rw-r--r-- | include/linux/percpu-defs.h | 8 |
4 files changed, 13 insertions, 2 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index e597ecc8753c..ac7e79654f3a 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -413,7 +413,7 @@ struct stack_canary { | |||
413 | char __pad[20]; /* canary at %gs:20 */ | 413 | char __pad[20]; /* canary at %gs:20 */ |
414 | unsigned long canary; | 414 | unsigned long canary; |
415 | }; | 415 | }; |
416 | DECLARE_PER_CPU(struct stack_canary, stack_canary) ____cacheline_aligned; | 416 | DECLARE_PER_CPU_ALIGNED(struct stack_canary, stack_canary); |
417 | #endif | 417 | #endif |
418 | #endif /* X86_64 */ | 418 | #endif /* X86_64 */ |
419 | 419 | ||
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 7d84bc4c1188..f23e236391a3 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -1043,7 +1043,7 @@ DEFINE_PER_CPU(struct orig_ist, orig_ist); | |||
1043 | #else /* CONFIG_X86_64 */ | 1043 | #else /* CONFIG_X86_64 */ |
1044 | 1044 | ||
1045 | #ifdef CONFIG_CC_STACKPROTECTOR | 1045 | #ifdef CONFIG_CC_STACKPROTECTOR |
1046 | DEFINE_PER_CPU(struct stack_canary, stack_canary) ____cacheline_aligned; | 1046 | DEFINE_PER_CPU_ALIGNED(struct stack_canary, stack_canary); |
1047 | #endif | 1047 | #endif |
1048 | 1048 | ||
1049 | /* Make sure %fs and %gs are initialized properly in idle threads */ | 1049 | /* Make sure %fs and %gs are initialized properly in idle threads */ |
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index aa00800adacc..90079c373f1c 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
@@ -81,14 +81,17 @@ extern void setup_per_cpu_areas(void); | |||
81 | 81 | ||
82 | #ifdef MODULE | 82 | #ifdef MODULE |
83 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | 83 | #define PER_CPU_SHARED_ALIGNED_SECTION "" |
84 | #define PER_CPU_ALIGNED_SECTION "" | ||
84 | #else | 85 | #else |
85 | #define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" | 86 | #define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" |
87 | #define PER_CPU_ALIGNED_SECTION ".shared_aligned" | ||
86 | #endif | 88 | #endif |
87 | #define PER_CPU_FIRST_SECTION ".first" | 89 | #define PER_CPU_FIRST_SECTION ".first" |
88 | 90 | ||
89 | #else | 91 | #else |
90 | 92 | ||
91 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | 93 | #define PER_CPU_SHARED_ALIGNED_SECTION "" |
94 | #define PER_CPU_ALIGNED_SECTION ".shared_aligned" | ||
92 | #define PER_CPU_FIRST_SECTION "" | 95 | #define PER_CPU_FIRST_SECTION "" |
93 | 96 | ||
94 | #endif | 97 | #endif |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 68438e18fff4..3058cf9dd3d4 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
@@ -66,6 +66,14 @@ | |||
66 | DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ | 66 | DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ |
67 | ____cacheline_aligned_in_smp | 67 | ____cacheline_aligned_in_smp |
68 | 68 | ||
69 | #define DECLARE_PER_CPU_ALIGNED(type, name) \ | ||
70 | DECLARE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION) \ | ||
71 | ____cacheline_aligned | ||
72 | |||
73 | #define DEFINE_PER_CPU_ALIGNED(type, name) \ | ||
74 | DEFINE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION) \ | ||
75 | ____cacheline_aligned | ||
76 | |||
69 | /* | 77 | /* |
70 | * Declaration/definition used for per-CPU variables that must be page aligned. | 78 | * Declaration/definition used for per-CPU variables that must be page aligned. |
71 | */ | 79 | */ |