diff options
author | David Howells <dhowells@redhat.com> | 2009-04-21 18:00:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-21 22:39:59 -0400 |
commit | 9b8de7479d0dbab1ed98b5b015d44232c9d3d08e (patch) | |
tree | 1b138996efe642f03699a7737af109dfa72ef830 /arch/x86/include/asm | |
parent | ccc5ff94c66e628d3c501b26ace5d4339667715d (diff) |
FRV: Fix the section attribute on UP DECLARE_PER_CPU()
In non-SMP mode, the variable section attribute specified by DECLARE_PER_CPU()
does not agree with that specified by DEFINE_PER_CPU(). This means that
architectures that have a small data section references relative to a base
register may throw up linkage errors due to too great a displacement between
where the base register points and the per-CPU variable.
On FRV, the .h declaration says that the variable is in the .sdata section, but
the .c definition says it's actually in the .data section. The linker throws
up the following errors:
kernel/built-in.o: In function `release_task':
kernel/exit.c:78: relocation truncated to fit: R_FRV_GPREL12 against symbol `per_cpu__process_counts' defined in .data section in kernel/built-in.o
kernel/exit.c:78: relocation truncated to fit: R_FRV_GPREL12 against symbol `per_cpu__process_counts' defined in .data section in kernel/built-in.o
To fix this, DECLARE_PER_CPU() should simply apply the same section attribute
as does DEFINE_PER_CPU(). However, this is made slightly more complex by
virtue of the fact that there are several variants on DEFINE, so these need to
be matched by variants on DECLARE.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/desc.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/hardirq.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/processor.h | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/tlbflush.h | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h index 5623c50d67b2..c45f415ce315 100644 --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h | |||
@@ -37,7 +37,7 @@ extern gate_desc idt_table[]; | |||
37 | struct gdt_page { | 37 | struct gdt_page { |
38 | struct desc_struct gdt[GDT_ENTRIES]; | 38 | struct desc_struct gdt[GDT_ENTRIES]; |
39 | } __attribute__((aligned(PAGE_SIZE))); | 39 | } __attribute__((aligned(PAGE_SIZE))); |
40 | DECLARE_PER_CPU(struct gdt_page, gdt_page); | 40 | DECLARE_PER_CPU_PAGE_ALIGNED(struct gdt_page, gdt_page); |
41 | 41 | ||
42 | static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) | 42 | static inline struct desc_struct *get_cpu_gdt_table(unsigned int cpu) |
43 | { | 43 | { |
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h index 039db6aa8e02..37555e52f980 100644 --- a/arch/x86/include/asm/hardirq.h +++ b/arch/x86/include/asm/hardirq.h | |||
@@ -26,7 +26,7 @@ typedef struct { | |||
26 | #endif | 26 | #endif |
27 | } ____cacheline_aligned irq_cpustat_t; | 27 | } ____cacheline_aligned irq_cpustat_t; |
28 | 28 | ||
29 | DECLARE_PER_CPU(irq_cpustat_t, irq_stat); | 29 | DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); |
30 | 30 | ||
31 | /* We can have at most NR_VECTORS irqs routed to a cpu at a time */ | 31 | /* We can have at most NR_VECTORS irqs routed to a cpu at a time */ |
32 | #define MAX_HARDIRQS_PER_CPU NR_VECTORS | 32 | #define MAX_HARDIRQS_PER_CPU NR_VECTORS |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index fcf4d92e7e04..c2cceae709c8 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -138,7 +138,7 @@ extern struct tss_struct doublefault_tss; | |||
138 | extern __u32 cleared_cpu_caps[NCAPINTS]; | 138 | extern __u32 cleared_cpu_caps[NCAPINTS]; |
139 | 139 | ||
140 | #ifdef CONFIG_SMP | 140 | #ifdef CONFIG_SMP |
141 | DECLARE_PER_CPU(struct cpuinfo_x86, cpu_info); | 141 | DECLARE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); |
142 | #define cpu_data(cpu) per_cpu(cpu_info, cpu) | 142 | #define cpu_data(cpu) per_cpu(cpu_info, cpu) |
143 | #define current_cpu_data __get_cpu_var(cpu_info) | 143 | #define current_cpu_data __get_cpu_var(cpu_info) |
144 | #else | 144 | #else |
@@ -270,7 +270,7 @@ struct tss_struct { | |||
270 | 270 | ||
271 | } ____cacheline_aligned; | 271 | } ____cacheline_aligned; |
272 | 272 | ||
273 | DECLARE_PER_CPU(struct tss_struct, init_tss); | 273 | DECLARE_PER_CPU_SHARED_ALIGNED(struct tss_struct, init_tss); |
274 | 274 | ||
275 | /* | 275 | /* |
276 | * Save the original ist values for checking stack pointers during debugging | 276 | * Save the original ist values for checking stack pointers during debugging |
@@ -393,7 +393,7 @@ union irq_stack_union { | |||
393 | }; | 393 | }; |
394 | }; | 394 | }; |
395 | 395 | ||
396 | DECLARE_PER_CPU(union irq_stack_union, irq_stack_union); | 396 | DECLARE_PER_CPU_FIRST(union irq_stack_union, irq_stack_union); |
397 | DECLARE_INIT_PER_CPU(irq_stack_union); | 397 | DECLARE_INIT_PER_CPU(irq_stack_union); |
398 | 398 | ||
399 | DECLARE_PER_CPU(char *, irq_stack_ptr); | 399 | DECLARE_PER_CPU(char *, irq_stack_ptr); |
diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h index d3539f998f88..16a5c84b0329 100644 --- a/arch/x86/include/asm/tlbflush.h +++ b/arch/x86/include/asm/tlbflush.h | |||
@@ -152,7 +152,7 @@ struct tlb_state { | |||
152 | struct mm_struct *active_mm; | 152 | struct mm_struct *active_mm; |
153 | int state; | 153 | int state; |
154 | }; | 154 | }; |
155 | DECLARE_PER_CPU(struct tlb_state, cpu_tlbstate); | 155 | 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 | { |