diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-12 21:18:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-12 21:18:05 -0400 |
commit | d645727bdc2aed8e2e0e9496248f735481b5049a (patch) | |
tree | 079fa3cf369dbf0dc0663fe1b0a62460c522a8e9 /arch/s390/kernel/kprobes.c | |
parent | cd166bd0dde265a97dd9aa8e3451a2646d96d04b (diff) | |
parent | 310d6b671588dd7695cbc0d09d02e41d94a42bed (diff) |
Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6: (30 commits)
[S390] wire up sys_perf_counter_open
[S390] wire up sys_rt_tgsigqueueinfo
[S390] ftrace: add system call tracer support
[S390] ftrace: add function graph tracer support
[S390] ftrace: add function trace mcount test support
[S390] ftrace: add dynamic ftrace support
[S390] kprobes: use probe_kernel_write
[S390] maccess: arch specific probe_kernel_write() implementation
[S390] maccess: add weak attribute to probe_kernel_write
[S390] profile_tick called twice
[S390] dasd: forward internal errors to dasd_sleep_on caller
[S390] dasd: sync after async probe
[S390] dasd: check_characteristics cleanup
[S390] dasd: no High Performance FICON in 31-bit mode
[S390] dcssblk: revert devt conversion
[S390] qdio: fix access beyond ARRAY_SIZE of irq_ptr->{in,out}put_qs
[S390] vmalloc: add vmalloc kernel parameter support
[S390] uaccess: use might_fault() instead of might_sleep()
[S390] 3270: lock dependency fixes
[S390] 3270: do not register with tty_register_device
...
Diffstat (limited to 'arch/s390/kernel/kprobes.c')
-rw-r--r-- | arch/s390/kernel/kprobes.c | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index a01cf0284db2..9bb2f6241d9f 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c | |||
@@ -25,9 +25,9 @@ | |||
25 | #include <linux/preempt.h> | 25 | #include <linux/preempt.h> |
26 | #include <linux/stop_machine.h> | 26 | #include <linux/stop_machine.h> |
27 | #include <linux/kdebug.h> | 27 | #include <linux/kdebug.h> |
28 | #include <linux/uaccess.h> | ||
28 | #include <asm/cacheflush.h> | 29 | #include <asm/cacheflush.h> |
29 | #include <asm/sections.h> | 30 | #include <asm/sections.h> |
30 | #include <asm/uaccess.h> | ||
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | 32 | ||
33 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; | 33 | DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL; |
@@ -155,35 +155,8 @@ void __kprobes get_instruction_type(struct arch_specific_insn *ainsn) | |||
155 | static int __kprobes swap_instruction(void *aref) | 155 | static int __kprobes swap_instruction(void *aref) |
156 | { | 156 | { |
157 | struct ins_replace_args *args = aref; | 157 | struct ins_replace_args *args = aref; |
158 | u32 *addr; | ||
159 | u32 instr; | ||
160 | int err = -EFAULT; | ||
161 | 158 | ||
162 | /* | 159 | return probe_kernel_write(args->ptr, &args->new, sizeof(args->new)); |
163 | * Text segment is read-only, hence we use stura to bypass dynamic | ||
164 | * address translation to exchange the instruction. Since stura | ||
165 | * always operates on four bytes, but we only want to exchange two | ||
166 | * bytes do some calculations to get things right. In addition we | ||
167 | * shall not cross any page boundaries (vmalloc area!) when writing | ||
168 | * the new instruction. | ||
169 | */ | ||
170 | addr = (u32 *)((unsigned long)args->ptr & -4UL); | ||
171 | if ((unsigned long)args->ptr & 2) | ||
172 | instr = ((*addr) & 0xffff0000) | args->new; | ||
173 | else | ||
174 | instr = ((*addr) & 0x0000ffff) | args->new << 16; | ||
175 | |||
176 | asm volatile( | ||
177 | " lra %1,0(%1)\n" | ||
178 | "0: stura %2,%1\n" | ||
179 | "1: la %0,0\n" | ||
180 | "2:\n" | ||
181 | EX_TABLE(0b,2b) | ||
182 | : "+d" (err) | ||
183 | : "a" (addr), "d" (instr) | ||
184 | : "memory", "cc"); | ||
185 | |||
186 | return err; | ||
187 | } | 160 | } |
188 | 161 | ||
189 | void __kprobes arch_arm_kprobe(struct kprobe *p) | 162 | void __kprobes arch_arm_kprobe(struct kprobe *p) |