Lines Matching full:target

473 static int hw_break_get(struct task_struct *target,  in hw_break_get()  argument
491 ret = ptrace_hbp_get_addr(note_type, target, idx, &addr); in hw_break_get()
494 ret = ptrace_hbp_get_ctrl(note_type, target, idx, &ctrl); in hw_break_get()
505 static int hw_break_set(struct task_struct *target, in hw_break_set() argument
530 ret = ptrace_hbp_set_addr(note_type, target, idx, addr); in hw_break_set()
541 ret = ptrace_hbp_set_ctrl(note_type, target, idx, ctrl); in hw_break_set()
559 static int gpr_get(struct task_struct *target, in gpr_get() argument
563 struct user_pt_regs *uregs = &task_pt_regs(target)->user_regs; in gpr_get()
567 static int gpr_set(struct task_struct *target, const struct user_regset *regset, in gpr_set() argument
572 struct user_pt_regs newregs = task_pt_regs(target)->user_regs; in gpr_set()
578 if (!valid_user_regs(&newregs, target)) in gpr_set()
581 task_pt_regs(target)->user_regs = newregs; in gpr_set()
585 static int fpr_active(struct task_struct *target, const struct user_regset *regset) in fpr_active() argument
595 static int __fpr_get(struct task_struct *target, in __fpr_get() argument
601 sve_sync_to_fpsimd(target); in __fpr_get()
603 uregs = &target->thread.uw.fpsimd_state; in __fpr_get()
608 static int fpr_get(struct task_struct *target, const struct user_regset *regset, in fpr_get() argument
614 if (target == current) in fpr_get()
617 return __fpr_get(target, regset, to); in fpr_get()
620 static int __fpr_set(struct task_struct *target, in __fpr_set() argument
630 * Ensure target->thread.uw.fpsimd_state is up to date, so that a in __fpr_set()
633 sve_sync_to_fpsimd(target); in __fpr_set()
635 newstate = target->thread.uw.fpsimd_state; in __fpr_set()
642 target->thread.uw.fpsimd_state = newstate; in __fpr_set()
647 static int fpr_set(struct task_struct *target, const struct user_regset *regset, in fpr_set() argument
656 ret = __fpr_set(target, regset, pos, count, kbuf, ubuf, 0); in fpr_set()
660 sve_sync_from_fpsimd_zeropad(target); in fpr_set()
661 fpsimd_flush_task_state(target); in fpr_set()
666 static int tls_get(struct task_struct *target, const struct user_regset *regset, in tls_get() argument
671 if (target == current) in tls_get()
674 ret = membuf_store(&to, target->thread.uw.tp_value); in tls_get()
676 ret = membuf_store(&to, target->thread.tpidr2_el0); in tls_get()
683 static int tls_set(struct task_struct *target, const struct user_regset *regset, in tls_set() argument
690 tls[0] = target->thread.uw.tp_value; in tls_set()
692 tls[1] = target->thread.tpidr2_el0; in tls_set()
698 target->thread.uw.tp_value = tls[0]; in tls_set()
700 target->thread.tpidr2_el0 = tls[1]; in tls_set()
705 static int system_call_get(struct task_struct *target, in system_call_get() argument
709 return membuf_store(&to, task_pt_regs(target)->syscallno); in system_call_get()
712 static int system_call_set(struct task_struct *target, in system_call_set() argument
717 int syscallno = task_pt_regs(target)->syscallno; in system_call_set()
724 task_pt_regs(target)->syscallno = syscallno; in system_call_set()
731 struct task_struct *target, in sve_init_header_from_task() argument
742 if (thread_sm_enabled(&target->thread)) in sve_init_header_from_task()
750 if (test_tsk_thread_flag(target, TIF_SVE_VL_INHERIT)) in sve_init_header_from_task()
752 fpsimd_only = !test_tsk_thread_flag(target, TIF_SVE); in sve_init_header_from_task()
755 if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT)) in sve_init_header_from_task()
772 header->vl = task_get_vl(target, type); in sve_init_header_from_task()
786 static int sve_get_common(struct task_struct *target, in sve_get_common() argument
796 sve_init_header_from_task(&header, target, type); in sve_get_common()
801 if (target == current) in sve_get_common()
809 return __fpr_get(target, regset, to); in sve_get_common()
814 membuf_write(&to, target->thread.sve_state, end - start); in sve_get_common()
826 membuf_write(&to, &target->thread.uw.fpsimd_state.fpsr, in sve_get_common()
838 static int sve_get(struct task_struct *target, in sve_get() argument
845 return sve_get_common(target, regset, to, ARM64_VEC_SVE); in sve_get()
848 static int sve_set_common(struct task_struct *target, in sve_set_common() argument
871 ret = vec_set_vector_length(target, type, header.vl, in sve_set_common()
877 vq = sve_vq_from_vl(task_get_vl(target, type)); in sve_set_common()
881 u64 old_svcr = target->thread.svcr; in sve_set_common()
885 target->thread.svcr &= ~SVCR_SM_MASK; in sve_set_common()
888 target->thread.svcr |= SVCR_SM_MASK; in sve_set_common()
899 if (target->thread.svcr != old_svcr) in sve_set_common()
900 sve_alloc(target, true); in sve_set_common()
907 ret = __fpr_set(target, regset, pos, count, kbuf, ubuf, in sve_set_common()
909 clear_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
911 fpsimd_force_sync_to_sve(target); in sve_set_common()
930 sve_alloc(target, true); in sve_set_common()
931 if (!target->thread.sve_state) { in sve_set_common()
933 clear_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
938 * Ensure target->thread.sve_state is up to date with target's in sve_set_common()
943 fpsimd_sync_to_sve(target); in sve_set_common()
944 set_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
950 target->thread.sve_state, in sve_set_common()
969 &target->thread.uw.fpsimd_state.fpsr, in sve_set_common()
973 fpsimd_flush_task_state(target); in sve_set_common()
977 static int sve_set(struct task_struct *target, in sve_set() argument
985 return sve_set_common(target, regset, pos, count, kbuf, ubuf, in sve_set()
993 static int ssve_get(struct task_struct *target, in ssve_get() argument
1000 return sve_get_common(target, regset, to, ARM64_VEC_SME); in ssve_get()
1003 static int ssve_set(struct task_struct *target, in ssve_set() argument
1011 return sve_set_common(target, regset, pos, count, kbuf, ubuf, in ssve_set()
1015 static int za_get(struct task_struct *target, in za_get() argument
1029 if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT)) in za_get()
1032 header.vl = task_get_sme_vl(target); in za_get()
1038 if (thread_za_enabled(&target->thread)) in za_get()
1048 if (target == current) in za_get()
1052 if (thread_za_enabled(&target->thread)) { in za_get()
1055 membuf_write(&to, target->thread.za_state, end - start); in za_get()
1064 static int za_set(struct task_struct *target, in za_set() argument
1090 ret = vec_set_vector_length(target, ARM64_VEC_SME, header.vl, in za_set()
1096 vq = sve_vq_from_vl(task_get_sme_vl(target)); in za_set()
1099 if (!target->thread.sve_state) { in za_set()
1100 sve_alloc(target, false); in za_set()
1101 if (!target->thread.sve_state) { in za_set()
1108 sme_alloc(target); in za_set()
1109 if (!target->thread.za_state) { in za_set()
1116 target->thread.svcr &= ~SVCR_ZA_MASK; in za_set()
1134 target->thread.za_state, in za_set()
1140 set_tsk_thread_flag(target, TIF_SME); in za_set()
1141 target->thread.svcr |= SVCR_ZA_MASK; in za_set()
1144 fpsimd_flush_task_state(target); in za_set()
1151 static int pac_mask_get(struct task_struct *target, in pac_mask_get() argument
1172 static int pac_enabled_keys_get(struct task_struct *target, in pac_enabled_keys_get() argument
1176 long enabled_keys = ptrauth_get_enabled_keys(target); in pac_enabled_keys_get()
1184 static int pac_enabled_keys_set(struct task_struct *target, in pac_enabled_keys_set() argument
1190 long enabled_keys = ptrauth_get_enabled_keys(target); in pac_enabled_keys_set()
1200 return ptrauth_set_enabled_keys(target, PR_PAC_ENABLED_KEYS_MASK, in pac_enabled_keys_set()
1238 static int pac_address_keys_get(struct task_struct *target, in pac_address_keys_get() argument
1242 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_address_keys_get()
1253 static int pac_address_keys_set(struct task_struct *target, in pac_address_keys_set() argument
1258 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_address_keys_set()
1287 static int pac_generic_keys_get(struct task_struct *target, in pac_generic_keys_get() argument
1291 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_generic_keys_get()
1302 static int pac_generic_keys_set(struct task_struct *target, in pac_generic_keys_set() argument
1307 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_generic_keys_set()
1327 static int tagged_addr_ctrl_get(struct task_struct *target, in tagged_addr_ctrl_get() argument
1331 long ctrl = get_tagged_addr_ctrl(target); in tagged_addr_ctrl_get()
1339 static int tagged_addr_ctrl_set(struct task_struct *target, const struct in tagged_addr_ctrl_set() argument
1351 return set_tagged_addr_ctrl(target, ctrl); in tagged_addr_ctrl_set()
1553 static int compat_gpr_get(struct task_struct *target, in compat_gpr_get() argument
1560 membuf_store(&to, compat_get_user_reg(target, i++)); in compat_gpr_get()
1564 static int compat_gpr_set(struct task_struct *target, in compat_gpr_set() argument
1582 newregs = *task_pt_regs(target); in compat_gpr_set()
1618 if (valid_user_regs(&newregs.user_regs, target)) in compat_gpr_set()
1619 *task_pt_regs(target) = newregs; in compat_gpr_set()
1626 static int compat_vfp_get(struct task_struct *target, in compat_vfp_get() argument
1636 uregs = &target->thread.uw.fpsimd_state; in compat_vfp_get()
1638 if (target == current) in compat_vfp_get()
1651 static int compat_vfp_set(struct task_struct *target, in compat_vfp_set() argument
1663 uregs = &target->thread.uw.fpsimd_state; in compat_vfp_set()
1678 fpsimd_flush_task_state(target); in compat_vfp_set()
1682 static int compat_tls_get(struct task_struct *target, in compat_tls_get() argument
1686 return membuf_store(&to, (compat_ulong_t)target->thread.uw.tp_value); in compat_tls_get()
1689 static int compat_tls_set(struct task_struct *target, in compat_tls_set() argument
1695 compat_ulong_t tls = target->thread.uw.tp_value; in compat_tls_set()
1701 target->thread.uw.tp_value = tls; in compat_tls_set()