Lines Matching +full:rx +full:- +full:input
1 // SPDX-License-Identifier: GPL-2.0
3 * User-space Probes (UProbes) for s390
25 return probe_is_prohibited_opcode(auprobe->insn); in arch_uprobe_analyze_insn()
30 if (psw_bits(regs->psw).eaba == PSW_BITS_AMODE_24BIT) in arch_uprobe_pre_xol()
31 return -EINVAL; in arch_uprobe_pre_xol()
32 if (!is_compat_task() && psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT) in arch_uprobe_pre_xol()
33 return -EINVAL; in arch_uprobe_pre_xol()
35 auprobe->saved_per = psw_bits(regs->psw).per; in arch_uprobe_pre_xol()
36 auprobe->saved_int_code = regs->int_code; in arch_uprobe_pre_xol()
37 regs->int_code = UPROBE_TRAP_NR; in arch_uprobe_pre_xol()
38 regs->psw.addr = current->utask->xol_vaddr; in arch_uprobe_pre_xol()
48 if (regs->int_code != UPROBE_TRAP_NR) in arch_uprobe_xol_was_trapped()
56 if (!(regs->psw.mask & PSW_MASK_PER)) in check_per_event()
70 regs->psw.addr >= current->thread.per_user.start && in check_per_event()
71 regs->psw.addr <= current->thread.per_user.end) in check_per_event()
79 int fixup = probe_get_fixup_type(auprobe->insn); in arch_uprobe_post_xol()
80 struct uprobe_task *utask = current->utask; in arch_uprobe_post_xol()
84 psw_bits(regs->psw).per = auprobe->saved_per; in arch_uprobe_post_xol()
85 regs->int_code = auprobe->saved_int_code; in arch_uprobe_post_xol()
88 regs->psw.addr += utask->vaddr - utask->xol_vaddr; in arch_uprobe_post_xol()
90 int reg = (auprobe->insn[0] & 0xf0) >> 4; in arch_uprobe_post_xol()
92 regs->gprs[reg] += utask->vaddr - utask->xol_vaddr; in arch_uprobe_post_xol()
95 int ilen = insn_length(auprobe->insn[0] >> 8); in arch_uprobe_post_xol()
97 if (regs->psw.addr - utask->xol_vaddr == ilen) in arch_uprobe_post_xol()
98 regs->psw.addr = utask->vaddr + ilen; in arch_uprobe_post_xol()
100 if (check_per_event(current->thread.per_event.cause, in arch_uprobe_post_xol()
101 current->thread.per_user.control, regs)) { in arch_uprobe_post_xol()
103 current->thread.per_event.address = utask->vaddr; in arch_uprobe_post_xol()
114 struct pt_regs *regs = args->regs; in arch_uprobe_exception_notify()
118 if (regs->int_code & 0x200) /* Trap during transaction */ in arch_uprobe_exception_notify()
138 regs->int_code = auprobe->saved_int_code; in arch_uprobe_abort_xol()
139 regs->psw.addr = current->utask->vaddr; in arch_uprobe_abort_xol()
140 current->thread.per_event.address = current->utask->vaddr; in arch_uprobe_abort_xol()
148 orig = regs->gprs[14]; in arch_uretprobe_hijack_return_addr()
149 regs->gprs[14] = trampoline; in arch_uretprobe_hijack_return_addr()
157 return user_stack_pointer(regs) <= ret->stack; in arch_uretprobe_is_alive()
159 return user_stack_pointer(regs) < ret->stack; in arch_uretprobe_is_alive()
166 psw->addr = __rewind_psw(*psw, -len); in adjust_psw_addr()
175 unsigned int mask = sizeof(*(ptr)) - 1; \
176 __typeof__(*(ptr)) input; \
181 else if (get_user(input, ptr)) \
184 *(output) = input; \
188 #define emu_store_ril(regs, ptr, input) \ argument
190 unsigned int mask = sizeof(*(ptr)) - 1; \
196 else if (put_user(*(input), __ptr)) \
207 unsigned int mask = sizeof(*(ptr)) - 1; \
208 __typeof__(*(ptr)) input; \
213 else if (get_user(input, ptr)) \
215 else if (input > *(cmp)) \
216 psw_bits((regs)->psw).cc = 1; \
217 else if (input < *(cmp)) \
218 psw_bits((regs)->psw).cc = 2; \
220 psw_bits((regs)->psw).cc = 0; \
246 if (!(regs->psw.mask & PSW_MASK_PER)) in sim_stor_event()
248 if (!(current->thread.per_user.control & PER_EVENT_STORE)) in sim_stor_event()
250 if ((void *)current->thread.per_user.start > (addr + len)) in sim_stor_event()
252 if ((void *)current->thread.per_user.end < addr) in sim_stor_event()
254 current->thread.per_event.address = regs->psw.addr; in sim_stor_event()
255 current->thread.per_event.cause = PER_EVENT_STORE >> 16; in sim_stor_event()
265 union split_register *rx; in handle_insn_ril() local
271 insn = (struct insn_ril *) &auprobe->insn; in handle_insn_ril()
272 rx = (union split_register *) ®s->gprs[insn->reg]; in handle_insn_ril()
273 uptr = (void *)(regs->psw.addr + (insn->disp * 2)); in handle_insn_ril()
274 ilen = insn_length(insn->opc0); in handle_insn_ril()
276 switch (insn->opc0) { in handle_insn_ril()
278 switch (insn->opc1) { in handle_insn_ril()
280 rx->u64 = (unsigned long)uptr; in handle_insn_ril()
285 switch (insn->opc1) { in handle_insn_ril()
287 rc = emu_load_ril((u16 __user *)uptr, &rx->u32[1]); in handle_insn_ril()
290 rc = emu_load_ril((s16 __user *)uptr, &rx->u64); in handle_insn_ril()
293 rc = emu_load_ril((s16 __user *)uptr, &rx->u32[1]); in handle_insn_ril()
296 rc = emu_load_ril((u16 __user *)uptr, &rx->u64); in handle_insn_ril()
299 rc = emu_load_ril((u64 __user *)uptr, &rx->u64); in handle_insn_ril()
302 rc = emu_load_ril((s32 __user *)uptr, &rx->u64); in handle_insn_ril()
305 rc = emu_load_ril((u32 __user *)uptr, &rx->u32[1]); in handle_insn_ril()
308 rc = emu_load_ril((u32 __user *)uptr, &rx->u64); in handle_insn_ril()
311 rc = emu_store_ril(regs, (u16 __user *)uptr, &rx->u16[3]); in handle_insn_ril()
314 rc = emu_store_ril(regs, (u64 __user *)uptr, &rx->u64); in handle_insn_ril()
317 rc = emu_store_ril(regs, (u32 __user *)uptr, &rx->u32[1]); in handle_insn_ril()
322 switch (insn->opc1) { in handle_insn_ril()
324 rc = emu_cmp_ril(regs, (s16 __user *)uptr, &rx->s64); in handle_insn_ril()
327 rc = emu_cmp_ril(regs, (s16 __user *)uptr, &rx->s32[1]); in handle_insn_ril()
330 rc = emu_cmp_ril(regs, (u16 __user *)uptr, &rx->u64); in handle_insn_ril()
333 rc = emu_cmp_ril(regs, (u16 __user *)uptr, &rx->u32[1]); in handle_insn_ril()
336 rc = emu_cmp_ril(regs, (s64 __user *)uptr, &rx->s64); in handle_insn_ril()
339 rc = emu_cmp_ril(regs, (u64 __user *)uptr, &rx->u64); in handle_insn_ril()
342 rc = emu_cmp_ril(regs, (s32 __user *)uptr, &rx->s64); in handle_insn_ril()
345 rc = emu_cmp_ril(regs, (s32 __user *)uptr, &rx->s32[1]); in handle_insn_ril()
348 rc = emu_cmp_ril(regs, (u32 __user *)uptr, &rx->u64); in handle_insn_ril()
351 rc = emu_cmp_ril(regs, (u32 __user *)uptr, &rx->u32[1]); in handle_insn_ril()
356 adjust_psw_addr(®s->psw, ilen); in handle_insn_ril()
359 regs->int_code = ilen << 16 | 0x0001; in handle_insn_ril()
363 regs->int_code = ilen << 16 | 0x0006; in handle_insn_ril()
367 regs->int_code = ilen << 16 | 0x0005; in handle_insn_ril()
375 if ((psw_bits(regs->psw).eaba == PSW_BITS_AMODE_24BIT) || in arch_uprobe_skip_sstep()
376 ((psw_bits(regs->psw).eaba == PSW_BITS_AMODE_31BIT) && in arch_uprobe_skip_sstep()
378 regs->psw.addr = __rewind_psw(regs->psw, UPROBE_SWBP_INSN_SIZE); in arch_uprobe_skip_sstep()
382 if (probe_is_insn_relative_long(auprobe->insn)) { in arch_uprobe_skip_sstep()