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()
894 if (target->thread.svcr != old_svcr) in sve_set_common()
895 sve_alloc(target, true); in sve_set_common()
902 ret = __fpr_set(target, regset, pos, count, kbuf, ubuf, in sve_set_common()
904 clear_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
905 target->thread.fp_type = FP_STATE_FPSIMD; in sve_set_common()
924 sve_alloc(target, true); in sve_set_common()
925 if (!target->thread.sve_state) { in sve_set_common()
927 clear_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
928 target->thread.fp_type = FP_STATE_FPSIMD; in sve_set_common()
938 fpsimd_sync_to_sve(target); in sve_set_common()
939 set_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
940 target->thread.fp_type = FP_STATE_SVE; in sve_set_common()
946 target->thread.sve_state, in sve_set_common()
962 &target->thread.uw.fpsimd_state.fpsr, in sve_set_common()
966 fpsimd_flush_task_state(target); in sve_set_common()
970 static int sve_set(struct task_struct *target, in sve_set() argument
978 return sve_set_common(target, regset, pos, count, kbuf, ubuf, in sve_set()
986 static int ssve_get(struct task_struct *target, in ssve_get() argument
993 return sve_get_common(target, regset, to, ARM64_VEC_SME); in ssve_get()
996 static int ssve_set(struct task_struct *target, in ssve_set() argument
1004 return sve_set_common(target, regset, pos, count, kbuf, ubuf, in ssve_set()
1008 static int za_get(struct task_struct *target, in za_get() argument
1022 if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT)) in za_get()
1025 header.vl = task_get_sme_vl(target); in za_get()
1031 if (thread_za_enabled(&target->thread)) in za_get()
1041 if (target == current) in za_get()
1045 if (thread_za_enabled(&target->thread)) { in za_get()
1048 membuf_write(&to, target->thread.sme_state, end - start); in za_get()
1057 static int za_set(struct task_struct *target, in za_set() argument
1083 ret = vec_set_vector_length(target, ARM64_VEC_SME, header.vl, in za_set()
1089 vq = sve_vq_from_vl(task_get_sme_vl(target)); in za_set()
1092 if (!target->thread.sve_state) { in za_set()
1093 sve_alloc(target, false); in za_set()
1094 if (!target->thread.sve_state) { in za_set()
1101 sme_alloc(target); in za_set()
1102 if (!target->thread.sme_state) { in za_set()
1109 target->thread.svcr &= ~SVCR_ZA_MASK; in za_set()
1127 target->thread.sme_state, in za_set()
1133 set_tsk_thread_flag(target, TIF_SME); in za_set()
1134 target->thread.svcr |= SVCR_ZA_MASK; in za_set()
1137 fpsimd_flush_task_state(target); in za_set()
1141 static int zt_get(struct task_struct *target, in zt_get() argument
1152 if (thread_za_enabled(&target->thread)) in zt_get()
1153 membuf_write(&to, thread_zt_state(&target->thread), in zt_get()
1161 static int zt_set(struct task_struct *target, in zt_set() argument
1171 if (!thread_za_enabled(&target->thread)) { in zt_set()
1172 sme_alloc(target); in zt_set()
1173 if (!target->thread.sme_state) in zt_set()
1178 thread_zt_state(&target->thread), in zt_set()
1181 target->thread.svcr |= SVCR_ZA_MASK; in zt_set()
1189 static int pac_mask_get(struct task_struct *target, in pac_mask_get() argument
1210 static int pac_enabled_keys_get(struct task_struct *target, in pac_enabled_keys_get() argument
1214 long enabled_keys = ptrauth_get_enabled_keys(target); in pac_enabled_keys_get()
1222 static int pac_enabled_keys_set(struct task_struct *target, in pac_enabled_keys_set() argument
1228 long enabled_keys = ptrauth_get_enabled_keys(target); in pac_enabled_keys_set()
1238 return ptrauth_set_enabled_keys(target, PR_PAC_ENABLED_KEYS_MASK, in pac_enabled_keys_set()
1276 static int pac_address_keys_get(struct task_struct *target, in pac_address_keys_get() argument
1280 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_address_keys_get()
1291 static int pac_address_keys_set(struct task_struct *target, in pac_address_keys_set() argument
1296 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_address_keys_set()
1325 static int pac_generic_keys_get(struct task_struct *target, in pac_generic_keys_get() argument
1329 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_generic_keys_get()
1340 static int pac_generic_keys_set(struct task_struct *target, in pac_generic_keys_set() argument
1345 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_generic_keys_set()
1365 static int tagged_addr_ctrl_get(struct task_struct *target, in tagged_addr_ctrl_get() argument
1369 long ctrl = get_tagged_addr_ctrl(target); in tagged_addr_ctrl_get()
1377 static int tagged_addr_ctrl_set(struct task_struct *target, const struct in tagged_addr_ctrl_set() argument
1389 return set_tagged_addr_ctrl(target, ctrl); in tagged_addr_ctrl_set()
1600 static int compat_gpr_get(struct task_struct *target, in compat_gpr_get() argument
1607 membuf_store(&to, compat_get_user_reg(target, i++)); in compat_gpr_get()
1611 static int compat_gpr_set(struct task_struct *target, in compat_gpr_set() argument
1629 newregs = *task_pt_regs(target); in compat_gpr_set()
1665 if (valid_user_regs(&newregs.user_regs, target)) in compat_gpr_set()
1666 *task_pt_regs(target) = newregs; in compat_gpr_set()
1673 static int compat_vfp_get(struct task_struct *target, in compat_vfp_get() argument
1683 uregs = &target->thread.uw.fpsimd_state; in compat_vfp_get()
1685 if (target == current) in compat_vfp_get()
1698 static int compat_vfp_set(struct task_struct *target, in compat_vfp_set() argument
1710 uregs = &target->thread.uw.fpsimd_state; in compat_vfp_set()
1725 fpsimd_flush_task_state(target); in compat_vfp_set()
1729 static int compat_tls_get(struct task_struct *target, in compat_tls_get() argument
1733 return membuf_store(&to, (compat_ulong_t)target->thread.uw.tp_value); in compat_tls_get()
1736 static int compat_tls_set(struct task_struct *target, in compat_tls_set() argument
1742 compat_ulong_t tls = target->thread.uw.tp_value; in compat_tls_set()
1748 target->thread.uw.tp_value = tls; in compat_tls_set()