aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/Kconfig2
-rw-r--r--include/asm-generic/percpu.h12
-rw-r--r--init/main.c4
-rw-r--r--kernel/module.c8
4 files changed, 13 insertions, 13 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index f0887d12a5bb..8e1b33c5405f 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -97,7 +97,7 @@ config GENERIC_TIME_VSYSCALL
97 bool 97 bool
98 default X86_64 98 default X86_64
99 99
100config ARCH_SETS_UP_PER_CPU_AREA 100config HAVE_SETUP_PER_CPU_AREA
101 def_bool X86_64 101 def_bool X86_64
102 102
103config ARCH_SUPPORTS_OPROFILE 103config ARCH_SUPPORTS_OPROFILE
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index c41b1a731129..4b8d31cda1a0 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -47,7 +47,7 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
47#endif 47#endif
48 48
49/* 49/*
50 * A percpu variable may point to a discarded reghions. The following are 50 * A percpu variable may point to a discarded regions. The following are
51 * established ways to produce a usable pointer from the percpu variable 51 * established ways to produce a usable pointer from the percpu variable
52 * offset. 52 * offset.
53 */ 53 */
@@ -59,18 +59,10 @@ extern unsigned long __per_cpu_offset[NR_CPUS];
59 (*SHIFT_PERCPU_PTR(&per_cpu_var(var), __my_cpu_offset)) 59 (*SHIFT_PERCPU_PTR(&per_cpu_var(var), __my_cpu_offset))
60 60
61 61
62#ifdef CONFIG_ARCH_SETS_UP_PER_CPU_AREA 62#ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA
63extern void setup_per_cpu_areas(void); 63extern void setup_per_cpu_areas(void);
64#endif 64#endif
65 65
66/* A macro to avoid #include hell... */
67#define percpu_modcopy(pcpudst, src, size) \
68do { \
69 unsigned int __i; \
70 for_each_possible_cpu(__i) \
71 memcpy((pcpudst)+per_cpu_offset(__i), \
72 (src), (size)); \
73} while (0)
74#else /* ! SMP */ 66#else /* ! SMP */
75 67
76#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu_var(var))) 68#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu_var(var)))
diff --git a/init/main.c b/init/main.c
index 5843fe996703..3316dffe3e57 100644
--- a/init/main.c
+++ b/init/main.c
@@ -363,7 +363,7 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { }
363 363
364#else 364#else
365 365
366#ifndef CONFIG_ARCH_SETS_UP_PER_CPU_AREA 366#ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA
367unsigned long __per_cpu_offset[NR_CPUS] __read_mostly; 367unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
368 368
369EXPORT_SYMBOL(__per_cpu_offset); 369EXPORT_SYMBOL(__per_cpu_offset);
@@ -384,7 +384,7 @@ static void __init setup_per_cpu_areas(void)
384 ptr += size; 384 ptr += size;
385 } 385 }
386} 386}
387#endif /* CONFIG_ARCH_SETS_UP_CPU_AREA */ 387#endif /* CONFIG_HAVE_SETUP_PER_CPU_AREA */
388 388
389/* Called by boot processor to activate the rest. */ 389/* Called by boot processor to activate the rest. */
390static void __init smp_init(void) 390static void __init smp_init(void)
diff --git a/kernel/module.c b/kernel/module.c
index f6a4e721fd49..bd60278ee703 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -430,6 +430,14 @@ static unsigned int find_pcpusec(Elf_Ehdr *hdr,
430 return find_sec(hdr, sechdrs, secstrings, ".data.percpu"); 430 return find_sec(hdr, sechdrs, secstrings, ".data.percpu");
431} 431}
432 432
433static void percpu_modcopy(void *pcpudest, const void *from, unsigned long size)
434{
435 int cpu;
436
437 for_each_possible_cpu(cpu)
438 memcpy(pcpudest + per_cpu_offset(cpu), from, size);
439}
440
433static int percpu_modinit(void) 441static int percpu_modinit(void)
434{ 442{
435 pcpu_num_used = 2; 443 pcpu_num_used = 2;