aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-03-31 17:13:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-03-31 17:13:25 -0400
commit176ab02d4916f09d5d8cb63372d142df4378cdea (patch)
tree7039b1282e7b34341789a5416fbd7ca5da0e557a /kernel
parente06df6a7eae1ab1ef4deb076aeeaed90e948e5c0 (diff)
parentef178f9238b142cc1020265e176b20d27fd02ba9 (diff)
Merge branch 'x86-asmlinkage-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 LTO changes from Peter Anvin: "More infrastructure work in preparation for link-time optimization (LTO). Most of these changes is to make sure symbols accessed from assembly code are properly marked as visible so the linker doesn't remove them. My understanding is that the changes to support LTO are still not upstream in binutils, but are on the way there. This patchset should conclude the x86-specific changes, and remaining patches to actually enable LTO will be fed through the Kbuild tree (other than keeping up with changes to the x86 code base, of course), although not necessarily in this merge window" * 'x86-asmlinkage-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (25 commits) Kbuild, lto: Handle basic LTO in modpost Kbuild, lto: Disable LTO for asm-offsets.c Kbuild, lto: Add a gcc-ld script to let run gcc as ld Kbuild, lto: add ld-version and ld-ifversion macros Kbuild, lto: Drop .number postfixes in modpost Kbuild, lto, workaround: Don't warn for initcall_reference in modpost lto: Disable LTO for sys_ni lto: Handle LTO common symbols in module loader lto, workaround: Add workaround for initcall reordering lto: Make asmlinkage __visible x86, lto: Disable LTO for the x86 VDSO initconst, x86: Fix initconst mistake in ts5500 code initconst: Fix initconst mistake in dcdbas asmlinkage: Make trace_hardirqs_on/off_caller visible asmlinkage, x86: Fix 32bit memcpy for LTO asmlinkage Make __stack_chk_failed and memcmp visible asmlinkage: Mark rwsem functions that can be called from assembler asmlinkage asmlinkage: Make main_extable_sort_needed visible asmlinkage, mutex: Mark __visible asmlinkage: Make trace_hardirq visible ...
Diffstat (limited to 'kernel')
-rw-r--r--kernel/Makefile3
-rw-r--r--kernel/extable.c2
-rw-r--r--kernel/locking/lockdep.c6
-rw-r--r--kernel/locking/mutex.c10
-rw-r--r--kernel/locking/rwsem-xadd.c4
-rw-r--r--kernel/module.c4
-rw-r--r--kernel/panic.c2
-rw-r--r--kernel/timer.c2
-rw-r--r--kernel/trace/trace_irqsoff.c4
9 files changed, 24 insertions, 13 deletions
diff --git a/kernel/Makefile b/kernel/Makefile
index 4fd847488b76..f2a8b6246ce9 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -18,6 +18,9 @@ CFLAGS_REMOVE_cgroup-debug.o = -pg
18CFLAGS_REMOVE_irq_work.o = -pg 18CFLAGS_REMOVE_irq_work.o = -pg
19endif 19endif
20 20
21# cond_syscall is currently not LTO compatible
22CFLAGS_sys_ni.o = $(DISABLE_LTO)
23
21obj-y += sched/ 24obj-y += sched/
22obj-y += locking/ 25obj-y += locking/
23obj-y += power/ 26obj-y += power/
diff --git a/kernel/extable.c b/kernel/extable.c
index 763faf037ec1..d8a6446adbcb 100644
--- a/kernel/extable.c
+++ b/kernel/extable.c
@@ -36,7 +36,7 @@ extern struct exception_table_entry __start___ex_table[];
36extern struct exception_table_entry __stop___ex_table[]; 36extern struct exception_table_entry __stop___ex_table[];
37 37
38/* Cleared by build time tools if the table is already sorted. */ 38/* Cleared by build time tools if the table is already sorted. */
39u32 __initdata main_extable_sort_needed = 1; 39u32 __initdata __visible main_extable_sort_needed = 1;
40 40
41/* Sort the kernel's built-in exception table */ 41/* Sort the kernel's built-in exception table */
42void __init sort_main_extable(void) 42void __init sort_main_extable(void)
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index bf0c6b0dd9c5..b0e9467922e1 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -2557,7 +2557,7 @@ static void __trace_hardirqs_on_caller(unsigned long ip)
2557 debug_atomic_inc(hardirqs_on_events); 2557 debug_atomic_inc(hardirqs_on_events);
2558} 2558}
2559 2559
2560void trace_hardirqs_on_caller(unsigned long ip) 2560__visible void trace_hardirqs_on_caller(unsigned long ip)
2561{ 2561{
2562 time_hardirqs_on(CALLER_ADDR0, ip); 2562 time_hardirqs_on(CALLER_ADDR0, ip);
2563 2563
@@ -2610,7 +2610,7 @@ EXPORT_SYMBOL(trace_hardirqs_on);
2610/* 2610/*
2611 * Hardirqs were disabled: 2611 * Hardirqs were disabled:
2612 */ 2612 */
2613void trace_hardirqs_off_caller(unsigned long ip) 2613__visible void trace_hardirqs_off_caller(unsigned long ip)
2614{ 2614{
2615 struct task_struct *curr = current; 2615 struct task_struct *curr = current;
2616 2616
@@ -4188,7 +4188,7 @@ void debug_show_held_locks(struct task_struct *task)
4188} 4188}
4189EXPORT_SYMBOL_GPL(debug_show_held_locks); 4189EXPORT_SYMBOL_GPL(debug_show_held_locks);
4190 4190
4191void lockdep_sys_exit(void) 4191asmlinkage void lockdep_sys_exit(void)
4192{ 4192{
4193 struct task_struct *curr = current; 4193 struct task_struct *curr = current;
4194 4194
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index 14fe72cc8ce7..bc73d33c6760 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -75,8 +75,7 @@ EXPORT_SYMBOL(__mutex_init);
75 * We also put the fastpath first in the kernel image, to make sure the 75 * We also put the fastpath first in the kernel image, to make sure the
76 * branch is predicted by the CPU as default-untaken. 76 * branch is predicted by the CPU as default-untaken.
77 */ 77 */
78static __used noinline void __sched 78__visible void __sched __mutex_lock_slowpath(atomic_t *lock_count);
79__mutex_lock_slowpath(atomic_t *lock_count);
80 79
81/** 80/**
82 * mutex_lock - acquire the mutex 81 * mutex_lock - acquire the mutex
@@ -189,7 +188,8 @@ static inline int mutex_can_spin_on_owner(struct mutex *lock)
189} 188}
190#endif 189#endif
191 190
192static __used noinline void __sched __mutex_unlock_slowpath(atomic_t *lock_count); 191__visible __used noinline
192void __sched __mutex_unlock_slowpath(atomic_t *lock_count);
193 193
194/** 194/**
195 * mutex_unlock - release the mutex 195 * mutex_unlock - release the mutex
@@ -716,7 +716,7 @@ __mutex_unlock_common_slowpath(atomic_t *lock_count, int nested)
716/* 716/*
717 * Release the lock, slowpath: 717 * Release the lock, slowpath:
718 */ 718 */
719static __used noinline void 719__visible void
720__mutex_unlock_slowpath(atomic_t *lock_count) 720__mutex_unlock_slowpath(atomic_t *lock_count)
721{ 721{
722 __mutex_unlock_common_slowpath(lock_count, 1); 722 __mutex_unlock_common_slowpath(lock_count, 1);
@@ -773,7 +773,7 @@ int __sched mutex_lock_killable(struct mutex *lock)
773} 773}
774EXPORT_SYMBOL(mutex_lock_killable); 774EXPORT_SYMBOL(mutex_lock_killable);
775 775
776static __used noinline void __sched 776__visible void __sched
777__mutex_lock_slowpath(atomic_t *lock_count) 777__mutex_lock_slowpath(atomic_t *lock_count)
778{ 778{
779 struct mutex *lock = container_of(lock_count, struct mutex, count); 779 struct mutex *lock = container_of(lock_count, struct mutex, count);
diff --git a/kernel/locking/rwsem-xadd.c b/kernel/locking/rwsem-xadd.c
index 19c5fa95e0b4..1d66e08e897d 100644
--- a/kernel/locking/rwsem-xadd.c
+++ b/kernel/locking/rwsem-xadd.c
@@ -143,6 +143,7 @@ __rwsem_do_wake(struct rw_semaphore *sem, enum rwsem_wake_type wake_type)
143/* 143/*
144 * wait for the read lock to be granted 144 * wait for the read lock to be granted
145 */ 145 */
146__visible
146struct rw_semaphore __sched *rwsem_down_read_failed(struct rw_semaphore *sem) 147struct rw_semaphore __sched *rwsem_down_read_failed(struct rw_semaphore *sem)
147{ 148{
148 long count, adjustment = -RWSEM_ACTIVE_READ_BIAS; 149 long count, adjustment = -RWSEM_ACTIVE_READ_BIAS;
@@ -190,6 +191,7 @@ struct rw_semaphore __sched *rwsem_down_read_failed(struct rw_semaphore *sem)
190/* 191/*
191 * wait until we successfully acquire the write lock 192 * wait until we successfully acquire the write lock
192 */ 193 */
194__visible
193struct rw_semaphore __sched *rwsem_down_write_failed(struct rw_semaphore *sem) 195struct rw_semaphore __sched *rwsem_down_write_failed(struct rw_semaphore *sem)
194{ 196{
195 long count, adjustment = -RWSEM_ACTIVE_WRITE_BIAS; 197 long count, adjustment = -RWSEM_ACTIVE_WRITE_BIAS;
@@ -252,6 +254,7 @@ struct rw_semaphore __sched *rwsem_down_write_failed(struct rw_semaphore *sem)
252 * handle waking up a waiter on the semaphore 254 * handle waking up a waiter on the semaphore
253 * - up_read/up_write has decremented the active part of count if we come here 255 * - up_read/up_write has decremented the active part of count if we come here
254 */ 256 */
257__visible
255struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem) 258struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem)
256{ 259{
257 unsigned long flags; 260 unsigned long flags;
@@ -272,6 +275,7 @@ struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem)
272 * - caller incremented waiting part of count and discovered it still negative 275 * - caller incremented waiting part of count and discovered it still negative
273 * - just wake up any readers at the front of the queue 276 * - just wake up any readers at the front of the queue
274 */ 277 */
278__visible
275struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem) 279struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem)
276{ 280{
277 unsigned long flags; 281 unsigned long flags;
diff --git a/kernel/module.c b/kernel/module.c
index ca2c1aded7ee..8dc7f5e80dd8 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1948,6 +1948,10 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
1948 1948
1949 switch (sym[i].st_shndx) { 1949 switch (sym[i].st_shndx) {
1950 case SHN_COMMON: 1950 case SHN_COMMON:
1951 /* Ignore common symbols */
1952 if (!strncmp(name, "__gnu_lto", 9))
1953 break;
1954
1951 /* We compiled with -fno-common. These are not 1955 /* We compiled with -fno-common. These are not
1952 supposed to happen. */ 1956 supposed to happen. */
1953 pr_debug("Common symbol: %s\n", name); 1957 pr_debug("Common symbol: %s\n", name);
diff --git a/kernel/panic.c b/kernel/panic.c
index 2270cfd1d6be..cca8a913ae7c 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -459,7 +459,7 @@ EXPORT_SYMBOL(warn_slowpath_null);
459 * Called when gcc's -fstack-protector feature is used, and 459 * Called when gcc's -fstack-protector feature is used, and
460 * gcc detects corruption of the on-stack canary value 460 * gcc detects corruption of the on-stack canary value
461 */ 461 */
462void __stack_chk_fail(void) 462__visible void __stack_chk_fail(void)
463{ 463{
464 panic("stack-protector: Kernel stack is corrupted in: %p\n", 464 panic("stack-protector: Kernel stack is corrupted in: %p\n",
465 __builtin_return_address(0)); 465 __builtin_return_address(0));
diff --git a/kernel/timer.c b/kernel/timer.c
index accfd241b9e5..d78de047599b 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -52,7 +52,7 @@
52#define CREATE_TRACE_POINTS 52#define CREATE_TRACE_POINTS
53#include <trace/events/timer.h> 53#include <trace/events/timer.h>
54 54
55u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES; 55__visible u64 jiffies_64 __cacheline_aligned_in_smp = INITIAL_JIFFIES;
56 56
57EXPORT_SYMBOL(jiffies_64); 57EXPORT_SYMBOL(jiffies_64);
58 58
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c
index 2aefbee93a6d..887ef88b0bc7 100644
--- a/kernel/trace/trace_irqsoff.c
+++ b/kernel/trace/trace_irqsoff.c
@@ -498,14 +498,14 @@ void trace_hardirqs_off(void)
498} 498}
499EXPORT_SYMBOL(trace_hardirqs_off); 499EXPORT_SYMBOL(trace_hardirqs_off);
500 500
501void trace_hardirqs_on_caller(unsigned long caller_addr) 501__visible void trace_hardirqs_on_caller(unsigned long caller_addr)
502{ 502{
503 if (!preempt_trace() && irq_trace()) 503 if (!preempt_trace() && irq_trace())
504 stop_critical_timing(CALLER_ADDR0, caller_addr); 504 stop_critical_timing(CALLER_ADDR0, caller_addr);
505} 505}
506EXPORT_SYMBOL(trace_hardirqs_on_caller); 506EXPORT_SYMBOL(trace_hardirqs_on_caller);
507 507
508void trace_hardirqs_off_caller(unsigned long caller_addr) 508__visible void trace_hardirqs_off_caller(unsigned long caller_addr)
509{ 509{
510 if (!preempt_trace() && irq_trace()) 510 if (!preempt_trace() && irq_trace())
511 start_critical_timing(CALLER_ADDR0, caller_addr); 511 start_critical_timing(CALLER_ADDR0, caller_addr);