diff options
Diffstat (limited to 'arch/s390/kernel/kprobes.c')
-rw-r--r-- | arch/s390/kernel/kprobes.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c index 9bb2f6241d9f..86783efa24ee 100644 --- a/arch/s390/kernel/kprobes.c +++ b/arch/s390/kernel/kprobes.c | |||
@@ -154,39 +154,35 @@ void __kprobes get_instruction_type(struct arch_specific_insn *ainsn) | |||
154 | 154 | ||
155 | static int __kprobes swap_instruction(void *aref) | 155 | static int __kprobes swap_instruction(void *aref) |
156 | { | 156 | { |
157 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | ||
158 | unsigned long status = kcb->kprobe_status; | ||
157 | struct ins_replace_args *args = aref; | 159 | struct ins_replace_args *args = aref; |
160 | int rc; | ||
158 | 161 | ||
159 | return probe_kernel_write(args->ptr, &args->new, sizeof(args->new)); | 162 | kcb->kprobe_status = KPROBE_SWAP_INST; |
163 | rc = probe_kernel_write(args->ptr, &args->new, sizeof(args->new)); | ||
164 | kcb->kprobe_status = status; | ||
165 | return rc; | ||
160 | } | 166 | } |
161 | 167 | ||
162 | void __kprobes arch_arm_kprobe(struct kprobe *p) | 168 | void __kprobes arch_arm_kprobe(struct kprobe *p) |
163 | { | 169 | { |
164 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | ||
165 | unsigned long status = kcb->kprobe_status; | ||
166 | struct ins_replace_args args; | 170 | struct ins_replace_args args; |
167 | 171 | ||
168 | args.ptr = p->addr; | 172 | args.ptr = p->addr; |
169 | args.old = p->opcode; | 173 | args.old = p->opcode; |
170 | args.new = BREAKPOINT_INSTRUCTION; | 174 | args.new = BREAKPOINT_INSTRUCTION; |
171 | |||
172 | kcb->kprobe_status = KPROBE_SWAP_INST; | ||
173 | stop_machine(swap_instruction, &args, NULL); | 175 | stop_machine(swap_instruction, &args, NULL); |
174 | kcb->kprobe_status = status; | ||
175 | } | 176 | } |
176 | 177 | ||
177 | void __kprobes arch_disarm_kprobe(struct kprobe *p) | 178 | void __kprobes arch_disarm_kprobe(struct kprobe *p) |
178 | { | 179 | { |
179 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | ||
180 | unsigned long status = kcb->kprobe_status; | ||
181 | struct ins_replace_args args; | 180 | struct ins_replace_args args; |
182 | 181 | ||
183 | args.ptr = p->addr; | 182 | args.ptr = p->addr; |
184 | args.old = BREAKPOINT_INSTRUCTION; | 183 | args.old = BREAKPOINT_INSTRUCTION; |
185 | args.new = p->opcode; | 184 | args.new = p->opcode; |
186 | |||
187 | kcb->kprobe_status = KPROBE_SWAP_INST; | ||
188 | stop_machine(swap_instruction, &args, NULL); | 185 | stop_machine(swap_instruction, &args, NULL); |
189 | kcb->kprobe_status = status; | ||
190 | } | 186 | } |
191 | 187 | ||
192 | void __kprobes arch_remove_kprobe(struct kprobe *p) | 188 | void __kprobes arch_remove_kprobe(struct kprobe *p) |