aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2011-01-05 06:47:18 -0500
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2011-01-05 06:47:23 -0500
commit5a8b589f8a35b2c69d1819e3365825e4385a844c (patch)
treef1ca18f216be8517432eee5db0b762c231e13ede /arch
parentfc0a1fea6b81095b6c0e01ec3407d04c8341974c (diff)
[S390] kprobes: instruction swap
Move the definition of the helper structure ins_replace_args to the only place where it is used and drop the old member as it is not needed. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/include/asm/kprobes.h5
-rw-r--r--arch/s390/kernel/kprobes.c16
2 files changed, 9 insertions, 12 deletions
diff --git a/arch/s390/include/asm/kprobes.h b/arch/s390/include/asm/kprobes.h
index 15d0dec8dbb4..e45b3d38d4f8 100644
--- a/arch/s390/include/asm/kprobes.h
+++ b/arch/s390/include/asm/kprobes.h
@@ -64,11 +64,6 @@ struct arch_specific_insn {
64 int reg; 64 int reg;
65}; 65};
66 66
67struct ins_replace_args {
68 kprobe_opcode_t *ptr;
69 kprobe_opcode_t old;
70 kprobe_opcode_t new;
71};
72struct prev_kprobe { 67struct prev_kprobe {
73 struct kprobe *kp; 68 struct kprobe *kp;
74 unsigned long status; 69 unsigned long status;
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 91c611f84ff7..1e75ec523577 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -157,17 +157,21 @@ void __kprobes get_instruction_type(struct arch_specific_insn *ainsn)
157 } 157 }
158} 158}
159 159
160struct ins_replace_args {
161 kprobe_opcode_t *ptr;
162 kprobe_opcode_t opcode;
163};
164
160static int __kprobes swap_instruction(void *aref) 165static int __kprobes swap_instruction(void *aref)
161{ 166{
162 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); 167 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
163 unsigned long status = kcb->kprobe_status; 168 unsigned long status = kcb->kprobe_status;
164 struct ins_replace_args *args = aref; 169 struct ins_replace_args *args = aref;
165 int rc;
166 170
167 kcb->kprobe_status = KPROBE_SWAP_INST; 171 kcb->kprobe_status = KPROBE_SWAP_INST;
168 rc = probe_kernel_write(args->ptr, &args->new, sizeof(args->new)); 172 probe_kernel_write(args->ptr, &args->opcode, sizeof(args->opcode));
169 kcb->kprobe_status = status; 173 kcb->kprobe_status = status;
170 return rc; 174 return 0;
171} 175}
172 176
173void __kprobes arch_arm_kprobe(struct kprobe *p) 177void __kprobes arch_arm_kprobe(struct kprobe *p)
@@ -175,8 +179,7 @@ void __kprobes arch_arm_kprobe(struct kprobe *p)
175 struct ins_replace_args args; 179 struct ins_replace_args args;
176 180
177 args.ptr = p->addr; 181 args.ptr = p->addr;
178 args.old = p->opcode; 182 args.opcode = BREAKPOINT_INSTRUCTION;
179 args.new = BREAKPOINT_INSTRUCTION;
180 stop_machine(swap_instruction, &args, NULL); 183 stop_machine(swap_instruction, &args, NULL);
181} 184}
182 185
@@ -185,8 +188,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
185 struct ins_replace_args args; 188 struct ins_replace_args args;
186 189
187 args.ptr = p->addr; 190 args.ptr = p->addr;
188 args.old = BREAKPOINT_INSTRUCTION; 191 args.opcode = p->opcode;
189 args.new = p->opcode;
190 stop_machine(swap_instruction, &args, NULL); 192 stop_machine(swap_instruction, &args, NULL);
191} 193}
192 194