aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2011-01-05 06:47:25 -0500
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2011-01-05 06:47:24 -0500
commit860dba45e81be2e1ba977617652ae36084daebaf (patch)
treeedeb79a565754fcec0d6bcfb225e36ad761cba48 /arch/s390
parent4a1886358b2d68f6f8745bfc10399c2376681acc (diff)
[S390] add kprobes annotations
Add kprobes annotations to get the massive 'probe kernel.function("*") {}' stress test working. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/entry.S4
-rw-r--r--arch/s390/kernel/entry64.S4
-rw-r--r--arch/s390/kernel/mcount.S2
-rw-r--r--arch/s390/kernel/mcount64.S2
-rw-r--r--arch/s390/kernel/process.c9
-rw-r--r--arch/s390/kernel/time.c3
-rw-r--r--arch/s390/kernel/traps.c6
-rw-r--r--arch/s390/kernel/vtime.c5
8 files changed, 26 insertions, 9 deletions
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 1ecc337fb679..68d1a02db6be 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -188,6 +188,8 @@ STACK_SIZE = 1 << STACK_SHIFT
188 ssm __SF_EMPTY(%r15) 188 ssm __SF_EMPTY(%r15)
189 .endm 189 .endm
190 190
191 .section .kprobes.text, "ax"
192
191/* 193/*
192 * Scheduler resume function, called by switch_to 194 * Scheduler resume function, called by switch_to
193 * gpr2 = (task_struct *) prev 195 * gpr2 = (task_struct *) prev
@@ -861,6 +863,8 @@ restart_crash:
861restart_go: 863restart_go:
862#endif 864#endif
863 865
866 .section .kprobes.text, "ax"
867
864#ifdef CONFIG_CHECK_STACK 868#ifdef CONFIG_CHECK_STACK
865/* 869/*
866 * The synchronous or the asynchronous stack overflowed. We are dead. 870 * The synchronous or the asynchronous stack overflowed. We are dead.
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 8f3e802174db..1c0dce58933a 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -197,6 +197,8 @@ _TIF_SYSCALL = (_TIF_SYSCALL_TRACE>>8 | _TIF_SYSCALL_AUDIT>>8 | \
197 ssm __SF_EMPTY(%r15) 197 ssm __SF_EMPTY(%r15)
198 .endm 198 .endm
199 199
200 .section .kprobes.text, "ax"
201
200/* 202/*
201 * Scheduler resume function, called by switch_to 203 * Scheduler resume function, called by switch_to
202 * gpr2 = (task_struct *) prev 204 * gpr2 = (task_struct *) prev
@@ -868,6 +870,8 @@ restart_crash:
868restart_go: 870restart_go:
869#endif 871#endif
870 872
873 .section .kprobes.text, "ax"
874
871#ifdef CONFIG_CHECK_STACK 875#ifdef CONFIG_CHECK_STACK
872/* 876/*
873 * The synchronous or the asynchronous stack overflowed. We are dead. 877 * The synchronous or the asynchronous stack overflowed. We are dead.
diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S
index dfe015d7398c..4a6e1a575f9e 100644
--- a/arch/s390/kernel/mcount.S
+++ b/arch/s390/kernel/mcount.S
@@ -7,6 +7,8 @@
7 7
8#include <asm/asm-offsets.h> 8#include <asm/asm-offsets.h>
9 9
10 .section .kprobes.text, "ax"
11
10 .globl ftrace_stub 12 .globl ftrace_stub
11ftrace_stub: 13ftrace_stub:
12 br %r14 14 br %r14
diff --git a/arch/s390/kernel/mcount64.S b/arch/s390/kernel/mcount64.S
index c37211c6092b..b2bae06ad6c7 100644
--- a/arch/s390/kernel/mcount64.S
+++ b/arch/s390/kernel/mcount64.S
@@ -7,6 +7,8 @@
7 7
8#include <asm/asm-offsets.h> 8#include <asm/asm-offsets.h>
9 9
10 .section .kprobes.text, "ax"
11
10 .globl ftrace_stub 12 .globl ftrace_stub
11ftrace_stub: 13ftrace_stub:
12 br %r14 14 br %r14
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index ec2e03b22ead..b825b3e1cb17 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -32,6 +32,7 @@
32#include <linux/kernel_stat.h> 32#include <linux/kernel_stat.h>
33#include <linux/syscalls.h> 33#include <linux/syscalls.h>
34#include <linux/compat.h> 34#include <linux/compat.h>
35#include <linux/kprobes.h>
35#include <asm/compat.h> 36#include <asm/compat.h>
36#include <asm/uaccess.h> 37#include <asm/uaccess.h>
37#include <asm/pgtable.h> 38#include <asm/pgtable.h>
@@ -116,15 +117,17 @@ void cpu_idle(void)
116 } 117 }
117} 118}
118 119
119extern void kernel_thread_starter(void); 120extern void __kprobes kernel_thread_starter(void);
120 121
121asm( 122asm(
122 ".align 4\n" 123 ".section .kprobes.text, \"ax\"\n"
124 ".global kernel_thread_starter\n"
123 "kernel_thread_starter:\n" 125 "kernel_thread_starter:\n"
124 " la 2,0(10)\n" 126 " la 2,0(10)\n"
125 " basr 14,9\n" 127 " basr 14,9\n"
126 " la 2,0\n" 128 " la 2,0\n"
127 " br 11\n"); 129 " br 11\n"
130 ".previous\n");
128 131
129int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) 132int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
130{ 133{
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index f754a6dc4f94..4c9d72d2e273 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -37,6 +37,7 @@
37#include <linux/clocksource.h> 37#include <linux/clocksource.h>
38#include <linux/clockchips.h> 38#include <linux/clockchips.h>
39#include <linux/gfp.h> 39#include <linux/gfp.h>
40#include <linux/kprobes.h>
40#include <asm/uaccess.h> 41#include <asm/uaccess.h>
41#include <asm/delay.h> 42#include <asm/delay.h>
42#include <asm/s390_ext.h> 43#include <asm/s390_ext.h>
@@ -60,7 +61,7 @@ static DEFINE_PER_CPU(struct clock_event_device, comparators);
60/* 61/*
61 * Scheduler clock - returns current time in nanosec units. 62 * Scheduler clock - returns current time in nanosec units.
62 */ 63 */
63unsigned long long notrace sched_clock(void) 64unsigned long long notrace __kprobes sched_clock(void)
64{ 65{
65 return (get_clock_monotonic() * 125) >> 9; 66 return (get_clock_monotonic() * 125) >> 9;
66} 67}
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index 70640822621a..bc4f32fcfa57 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -451,8 +451,8 @@ static inline void do_fp_trap(struct pt_regs *regs, void __user *location,
451 "floating point exception", regs, &si); 451 "floating point exception", regs, &si);
452} 452}
453 453
454static void illegal_op(struct pt_regs *regs, long pgm_int_code, 454static void __kprobes illegal_op(struct pt_regs *regs, long pgm_int_code,
455 unsigned long trans_exc_code) 455 unsigned long trans_exc_code)
456{ 456{
457 siginfo_t info; 457 siginfo_t info;
458 __u8 opcode[6]; 458 __u8 opcode[6];
@@ -688,7 +688,7 @@ static void space_switch_exception(struct pt_regs *regs, long pgm_int_code,
688 do_trap(pgm_int_code, SIGILL, "space switch event", regs, &info); 688 do_trap(pgm_int_code, SIGILL, "space switch event", regs, &info);
689} 689}
690 690
691asmlinkage void kernel_stack_overflow(struct pt_regs * regs) 691asmlinkage void __kprobes kernel_stack_overflow(struct pt_regs * regs)
692{ 692{
693 bust_spinlocks(1); 693 bust_spinlocks(1);
694 printk("Kernel stack overflow.\n"); 694 printk("Kernel stack overflow.\n");
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index 7eff9b7347c0..8636dd00e393 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -20,6 +20,7 @@
20#include <linux/rcupdate.h> 20#include <linux/rcupdate.h>
21#include <linux/posix-timers.h> 21#include <linux/posix-timers.h>
22#include <linux/cpu.h> 22#include <linux/cpu.h>
23#include <linux/kprobes.h>
23 24
24#include <asm/s390_ext.h> 25#include <asm/s390_ext.h>
25#include <asm/timer.h> 26#include <asm/timer.h>
@@ -122,7 +123,7 @@ void account_system_vtime(struct task_struct *tsk)
122} 123}
123EXPORT_SYMBOL_GPL(account_system_vtime); 124EXPORT_SYMBOL_GPL(account_system_vtime);
124 125
125void vtime_start_cpu(__u64 int_clock, __u64 enter_timer) 126void __kprobes vtime_start_cpu(__u64 int_clock, __u64 enter_timer)
126{ 127{
127 struct s390_idle_data *idle = &__get_cpu_var(s390_idle); 128 struct s390_idle_data *idle = &__get_cpu_var(s390_idle);
128 struct vtimer_queue *vq = &__get_cpu_var(virt_cpu_timer); 129 struct vtimer_queue *vq = &__get_cpu_var(virt_cpu_timer);
@@ -162,7 +163,7 @@ void vtime_start_cpu(__u64 int_clock, __u64 enter_timer)
162 idle->sequence++; 163 idle->sequence++;
163} 164}
164 165
165void vtime_stop_cpu(void) 166void __kprobes vtime_stop_cpu(void)
166{ 167{
167 struct s390_idle_data *idle = &__get_cpu_var(s390_idle); 168 struct s390_idle_data *idle = &__get_cpu_var(s390_idle);
168 struct vtimer_queue *vq = &__get_cpu_var(virt_cpu_timer); 169 struct vtimer_queue *vq = &__get_cpu_var(virt_cpu_timer);