Lines Matching refs: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
528 ret = ptrace_hbp_set_addr(note_type, target, idx, addr); in hw_break_set()
539 ret = ptrace_hbp_set_ctrl(note_type, target, idx, ctrl); in hw_break_set()
554 static int gpr_get(struct task_struct *target, in gpr_get() argument
558 struct user_pt_regs *uregs = &task_pt_regs(target)->user_regs; in gpr_get()
562 static int gpr_set(struct task_struct *target, const struct user_regset *regset, in gpr_set() argument
567 struct user_pt_regs newregs = task_pt_regs(target)->user_regs; in gpr_set()
573 if (!valid_user_regs(&newregs, target)) in gpr_set()
576 task_pt_regs(target)->user_regs = newregs; in gpr_set()
580 static int fpr_active(struct task_struct *target, const struct user_regset *regset) in fpr_active() argument
590 static int __fpr_get(struct task_struct *target, in __fpr_get() argument
596 sve_sync_to_fpsimd(target); in __fpr_get()
598 uregs = &target->thread.uw.fpsimd_state; in __fpr_get()
603 static int fpr_get(struct task_struct *target, const struct user_regset *regset, in fpr_get() argument
609 if (target == current) in fpr_get()
612 return __fpr_get(target, regset, to); in fpr_get()
615 static int __fpr_set(struct task_struct *target, in __fpr_set() argument
628 sve_sync_to_fpsimd(target); in __fpr_set()
630 newstate = target->thread.uw.fpsimd_state; in __fpr_set()
637 target->thread.uw.fpsimd_state = newstate; in __fpr_set()
642 static int fpr_set(struct task_struct *target, const struct user_regset *regset, in fpr_set() argument
651 ret = __fpr_set(target, regset, pos, count, kbuf, ubuf, 0); in fpr_set()
655 sve_sync_from_fpsimd_zeropad(target); in fpr_set()
656 fpsimd_flush_task_state(target); in fpr_set()
661 static int tls_get(struct task_struct *target, const struct user_regset *regset, in tls_get() argument
666 if (target == current) in tls_get()
669 ret = membuf_store(&to, target->thread.uw.tp_value); in tls_get()
671 ret = membuf_store(&to, target->thread.tpidr2_el0); in tls_get()
678 static int tls_set(struct task_struct *target, const struct user_regset *regset, in tls_set() argument
685 tls[0] = target->thread.uw.tp_value; in tls_set()
687 tls[1] = target->thread.tpidr2_el0; in tls_set()
693 target->thread.uw.tp_value = tls[0]; in tls_set()
695 target->thread.tpidr2_el0 = tls[1]; in tls_set()
700 static int system_call_get(struct task_struct *target, in system_call_get() argument
704 return membuf_store(&to, task_pt_regs(target)->syscallno); in system_call_get()
707 static int system_call_set(struct task_struct *target, in system_call_set() argument
712 int syscallno = task_pt_regs(target)->syscallno; in system_call_set()
719 task_pt_regs(target)->syscallno = syscallno; in system_call_set()
726 struct task_struct *target, in sve_init_header_from_task() argument
737 if (thread_sm_enabled(&target->thread)) in sve_init_header_from_task()
745 if (test_tsk_thread_flag(target, TIF_SVE_VL_INHERIT)) in sve_init_header_from_task()
747 fpsimd_only = !test_tsk_thread_flag(target, TIF_SVE); in sve_init_header_from_task()
750 if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT)) in sve_init_header_from_task()
767 header->vl = task_get_vl(target, type); in sve_init_header_from_task()
781 static int sve_get_common(struct task_struct *target, in sve_get_common() argument
791 sve_init_header_from_task(&header, target, type); in sve_get_common()
796 if (target == current) in sve_get_common()
804 return __fpr_get(target, regset, to); in sve_get_common()
809 membuf_write(&to, target->thread.sve_state, end - start); in sve_get_common()
821 membuf_write(&to, &target->thread.uw.fpsimd_state.fpsr, in sve_get_common()
833 static int sve_get(struct task_struct *target, in sve_get() argument
840 return sve_get_common(target, regset, to, ARM64_VEC_SVE); in sve_get()
843 static int sve_set_common(struct task_struct *target, in sve_set_common() argument
866 ret = vec_set_vector_length(target, type, header.vl, in sve_set_common()
872 vq = sve_vq_from_vl(task_get_vl(target, type)); in sve_set_common()
876 u64 old_svcr = target->thread.svcr; in sve_set_common()
880 target->thread.svcr &= ~SVCR_SM_MASK; in sve_set_common()
883 target->thread.svcr |= SVCR_SM_MASK; in sve_set_common()
889 sme_alloc(target, false); in sve_set_common()
890 set_tsk_thread_flag(target, TIF_SME); in sve_set_common()
902 if (target->thread.svcr != old_svcr) in sve_set_common()
903 sve_alloc(target, true); in sve_set_common()
910 ret = __fpr_set(target, regset, pos, count, kbuf, ubuf, in sve_set_common()
912 clear_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
913 target->thread.fp_type = FP_STATE_FPSIMD; in sve_set_common()
932 sve_alloc(target, true); in sve_set_common()
933 if (!target->thread.sve_state) { in sve_set_common()
935 clear_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
936 target->thread.fp_type = FP_STATE_FPSIMD; in sve_set_common()
947 fpsimd_sync_to_sve(target); in sve_set_common()
949 set_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
950 target->thread.fp_type = FP_STATE_SVE; in sve_set_common()
956 target->thread.sve_state, in sve_set_common()
972 &target->thread.uw.fpsimd_state.fpsr, in sve_set_common()
976 fpsimd_flush_task_state(target); in sve_set_common()
980 static int sve_set(struct task_struct *target, in sve_set() argument
988 return sve_set_common(target, regset, pos, count, kbuf, ubuf, in sve_set()
996 static int ssve_get(struct task_struct *target, in ssve_get() argument
1003 return sve_get_common(target, regset, to, ARM64_VEC_SME); in ssve_get()
1006 static int ssve_set(struct task_struct *target, in ssve_set() argument
1014 return sve_set_common(target, regset, pos, count, kbuf, ubuf, in ssve_set()
1018 static int za_get(struct task_struct *target, in za_get() argument
1032 if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT)) in za_get()
1035 header.vl = task_get_sme_vl(target); in za_get()
1041 if (thread_za_enabled(&target->thread)) in za_get()
1051 if (target == current) in za_get()
1055 if (thread_za_enabled(&target->thread)) { in za_get()
1058 membuf_write(&to, target->thread.sme_state, end - start); in za_get()
1067 static int za_set(struct task_struct *target, in za_set() argument
1093 ret = vec_set_vector_length(target, ARM64_VEC_SME, header.vl, in za_set()
1099 vq = sve_vq_from_vl(task_get_sme_vl(target)); in za_set()
1102 if (!target->thread.sve_state) { in za_set()
1103 sve_alloc(target, false); in za_set()
1104 if (!target->thread.sve_state) { in za_set()
1111 sme_alloc(target, true); in za_set()
1112 if (!target->thread.sme_state) { in za_set()
1119 target->thread.svcr &= ~SVCR_ZA_MASK; in za_set()
1137 target->thread.sme_state, in za_set()
1143 set_tsk_thread_flag(target, TIF_SME); in za_set()
1144 target->thread.svcr |= SVCR_ZA_MASK; in za_set()
1147 fpsimd_flush_task_state(target); in za_set()
1151 static int zt_get(struct task_struct *target, in zt_get() argument
1162 if (thread_za_enabled(&target->thread)) in zt_get()
1163 membuf_write(&to, thread_zt_state(&target->thread), in zt_get()
1171 static int zt_set(struct task_struct *target, in zt_set() argument
1182 sve_alloc(target, false); in zt_set()
1183 if (!target->thread.sve_state) in zt_set()
1186 if (!thread_za_enabled(&target->thread)) { in zt_set()
1187 sme_alloc(target, true); in zt_set()
1188 if (!target->thread.sme_state) in zt_set()
1193 thread_zt_state(&target->thread), in zt_set()
1196 target->thread.svcr |= SVCR_ZA_MASK; in zt_set()
1197 set_tsk_thread_flag(target, TIF_SME); in zt_set()
1200 fpsimd_flush_task_state(target); in zt_set()
1208 static int pac_mask_get(struct task_struct *target, in pac_mask_get() argument
1229 static int pac_enabled_keys_get(struct task_struct *target, in pac_enabled_keys_get() argument
1233 long enabled_keys = ptrauth_get_enabled_keys(target); in pac_enabled_keys_get()
1241 static int pac_enabled_keys_set(struct task_struct *target, in pac_enabled_keys_set() argument
1247 long enabled_keys = ptrauth_get_enabled_keys(target); in pac_enabled_keys_set()
1257 return ptrauth_set_enabled_keys(target, PR_PAC_ENABLED_KEYS_MASK, in pac_enabled_keys_set()
1295 static int pac_address_keys_get(struct task_struct *target, in pac_address_keys_get() argument
1299 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_address_keys_get()
1310 static int pac_address_keys_set(struct task_struct *target, in pac_address_keys_set() argument
1315 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_address_keys_set()
1344 static int pac_generic_keys_get(struct task_struct *target, in pac_generic_keys_get() argument
1348 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_generic_keys_get()
1359 static int pac_generic_keys_set(struct task_struct *target, in pac_generic_keys_set() argument
1364 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_generic_keys_set()
1384 static int tagged_addr_ctrl_get(struct task_struct *target, in tagged_addr_ctrl_get() argument
1388 long ctrl = get_tagged_addr_ctrl(target); in tagged_addr_ctrl_get()
1396 static int tagged_addr_ctrl_set(struct task_struct *target, const struct in tagged_addr_ctrl_set() argument
1408 return set_tagged_addr_ctrl(target, ctrl); in tagged_addr_ctrl_set()
1619 static int compat_gpr_get(struct task_struct *target, in compat_gpr_get() argument
1626 membuf_store(&to, compat_get_user_reg(target, i++)); in compat_gpr_get()
1630 static int compat_gpr_set(struct task_struct *target, in compat_gpr_set() argument
1648 newregs = *task_pt_regs(target); in compat_gpr_set()
1684 if (valid_user_regs(&newregs.user_regs, target)) in compat_gpr_set()
1685 *task_pt_regs(target) = newregs; in compat_gpr_set()
1692 static int compat_vfp_get(struct task_struct *target, in compat_vfp_get() argument
1702 uregs = &target->thread.uw.fpsimd_state; in compat_vfp_get()
1704 if (target == current) in compat_vfp_get()
1717 static int compat_vfp_set(struct task_struct *target, in compat_vfp_set() argument
1729 uregs = &target->thread.uw.fpsimd_state; in compat_vfp_set()
1744 fpsimd_flush_task_state(target); in compat_vfp_set()
1748 static int compat_tls_get(struct task_struct *target, in compat_tls_get() argument
1752 return membuf_store(&to, (compat_ulong_t)target->thread.uw.tp_value); in compat_tls_get()
1755 static int compat_tls_set(struct task_struct *target, in compat_tls_set() argument
1761 compat_ulong_t tls = target->thread.uw.tp_value; in compat_tls_set()
1767 target->thread.uw.tp_value = tls; in compat_tls_set()