Lines Matching full:target
474 static int hw_break_get(struct task_struct *target, in hw_break_get() argument
492 ret = ptrace_hbp_get_addr(note_type, target, idx, &addr); in hw_break_get()
495 ret = ptrace_hbp_get_ctrl(note_type, target, idx, &ctrl); in hw_break_get()
506 static int hw_break_set(struct task_struct *target, in hw_break_set() argument
529 ret = ptrace_hbp_set_addr(note_type, target, idx, addr); in hw_break_set()
540 ret = ptrace_hbp_set_ctrl(note_type, target, idx, ctrl); in hw_break_set()
555 static int gpr_get(struct task_struct *target, in gpr_get() argument
559 struct user_pt_regs *uregs = &task_pt_regs(target)->user_regs; in gpr_get()
563 static int gpr_set(struct task_struct *target, const struct user_regset *regset, in gpr_set() argument
568 struct user_pt_regs newregs = task_pt_regs(target)->user_regs; in gpr_set()
574 if (!valid_user_regs(&newregs, target)) in gpr_set()
577 task_pt_regs(target)->user_regs = newregs; in gpr_set()
581 static int fpr_active(struct task_struct *target, const struct user_regset *regset) in fpr_active() argument
591 static int __fpr_get(struct task_struct *target, in __fpr_get() argument
597 fpsimd_sync_from_effective_state(target); in __fpr_get()
599 uregs = &target->thread.uw.fpsimd_state; in __fpr_get()
604 static int fpr_get(struct task_struct *target, const struct user_regset *regset, in fpr_get() argument
610 if (target == current) in fpr_get()
613 return __fpr_get(target, regset, to); in fpr_get()
616 static int __fpr_set(struct task_struct *target, in __fpr_set() argument
626 * Ensure target->thread.uw.fpsimd_state is up to date, so that a in __fpr_set()
629 fpsimd_sync_from_effective_state(target); in __fpr_set()
631 newstate = target->thread.uw.fpsimd_state; in __fpr_set()
638 target->thread.uw.fpsimd_state = newstate; in __fpr_set()
643 static int fpr_set(struct task_struct *target, const struct user_regset *regset, in fpr_set() argument
652 ret = __fpr_set(target, regset, pos, count, kbuf, ubuf, 0); in fpr_set()
656 fpsimd_sync_to_effective_state_zeropad(target); in fpr_set()
657 fpsimd_flush_task_state(target); in fpr_set()
662 static int tls_get(struct task_struct *target, const struct user_regset *regset, in tls_get() argument
667 if (target == current) in tls_get()
670 ret = membuf_store(&to, target->thread.uw.tp_value); in tls_get()
672 ret = membuf_store(&to, target->thread.tpidr2_el0); in tls_get()
679 static int tls_set(struct task_struct *target, const struct user_regset *regset, in tls_set() argument
686 tls[0] = target->thread.uw.tp_value; in tls_set()
688 tls[1] = target->thread.tpidr2_el0; in tls_set()
694 target->thread.uw.tp_value = tls[0]; in tls_set()
696 target->thread.tpidr2_el0 = tls[1]; in tls_set()
701 static int fpmr_get(struct task_struct *target, const struct user_regset *regset, in fpmr_get() argument
707 if (target == current) in fpmr_get()
710 return membuf_store(&to, target->thread.uw.fpmr); in fpmr_get()
713 static int fpmr_set(struct task_struct *target, const struct user_regset *regset, in fpmr_set() argument
723 fpmr = target->thread.uw.fpmr; in fpmr_set()
729 target->thread.uw.fpmr = fpmr; in fpmr_set()
731 fpsimd_flush_task_state(target); in fpmr_set()
736 static int system_call_get(struct task_struct *target, in system_call_get() argument
740 return membuf_store(&to, task_pt_regs(target)->syscallno); in system_call_get()
743 static int system_call_set(struct task_struct *target, in system_call_set() argument
748 int syscallno = task_pt_regs(target)->syscallno; in system_call_set()
755 task_pt_regs(target)->syscallno = syscallno; in system_call_set()
762 struct task_struct *target, in sve_init_header_from_task() argument
772 if (thread_sm_enabled(&target->thread)) in sve_init_header_from_task()
778 if (active && target->thread.fp_type == FP_STATE_SVE) in sve_init_header_from_task()
785 if (test_tsk_thread_flag(target, TIF_SVE_VL_INHERIT)) in sve_init_header_from_task()
789 if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT)) in sve_init_header_from_task()
797 header->vl = task_get_vl(target, type); in sve_init_header_from_task()
814 static int sve_get_common(struct task_struct *target, in sve_get_common() argument
823 if (target == current) in sve_get_common()
827 sve_init_header_from_task(&header, target, type); in sve_get_common()
844 return __fpr_get(target, regset, to); in sve_get_common()
849 membuf_write(&to, target->thread.sve_state, end - start); in sve_get_common()
861 membuf_write(&to, &target->thread.uw.fpsimd_state.fpsr, in sve_get_common()
873 static int sve_get(struct task_struct *target, in sve_get() argument
880 return sve_get_common(target, regset, to, ARM64_VEC_SVE); in sve_get()
883 static int sve_set_common(struct task_struct *target, in sve_set_common() argument
895 fpsimd_flush_task_state(target); in sve_set_common()
932 ret = vec_set_vector_length(target, type, header.vl, in sve_set_common()
951 sme_alloc(target, false); in sve_set_common()
952 if (!target->thread.sme_state) in sve_set_common()
958 sve_alloc(target, true); in sve_set_common()
959 if (!target->thread.sve_state) in sve_set_common()
968 vq = sve_vq_from_vl(task_get_vl(target, type)); in sve_set_common()
973 target->thread.svcr &= ~SVCR_SM_MASK; in sve_set_common()
974 set_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
977 target->thread.svcr |= SVCR_SM_MASK; in sve_set_common()
978 set_tsk_thread_flag(target, TIF_SME); in sve_set_common()
986 memset(&target->thread.uw.fpsimd_state, 0, in sve_set_common()
987 sizeof(target->thread.uw.fpsimd_state)); in sve_set_common()
993 clear_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
994 target->thread.fp_type = FP_STATE_FPSIMD; in sve_set_common()
995 ret = __fpr_set(target, regset, pos, count, kbuf, ubuf, in sve_set_common()
1002 target->thread.fp_type = FP_STATE_SVE; in sve_set_common()
1016 target->thread.sve_state, in sve_set_common()
1032 &target->thread.uw.fpsimd_state.fpsr, in sve_set_common()
1038 static int sve_set(struct task_struct *target, in sve_set() argument
1046 return sve_set_common(target, regset, pos, count, kbuf, ubuf, in sve_set()
1054 static int ssve_get(struct task_struct *target, in ssve_get() argument
1061 return sve_get_common(target, regset, to, ARM64_VEC_SME); in ssve_get()
1064 static int ssve_set(struct task_struct *target, in ssve_set() argument
1072 return sve_set_common(target, regset, pos, count, kbuf, ubuf, in ssve_set()
1076 static int za_get(struct task_struct *target, in za_get() argument
1090 if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT)) in za_get()
1093 header.vl = task_get_sme_vl(target); in za_get()
1099 if (thread_za_enabled(&target->thread)) in za_get()
1109 if (target == current) in za_get()
1113 if (thread_za_enabled(&target->thread)) { in za_get()
1116 membuf_write(&to, target->thread.sme_state, end - start); in za_get()
1125 static int za_set(struct task_struct *target, in za_set() argument
1151 ret = vec_set_vector_length(target, ARM64_VEC_SME, header.vl, in za_set()
1161 vq = sve_vq_from_vl(task_get_sme_vl(target)); in za_set()
1164 if (!target->thread.sve_state) { in za_set()
1165 sve_alloc(target, false); in za_set()
1166 if (!target->thread.sve_state) { in za_set()
1176 sme_alloc(target, !thread_za_enabled(&target->thread)); in za_set()
1177 if (!target->thread.sme_state) in za_set()
1182 target->thread.svcr &= ~SVCR_ZA_MASK; in za_set()
1200 target->thread.sme_state, in za_set()
1206 set_tsk_thread_flag(target, TIF_SME); in za_set()
1207 target->thread.svcr |= SVCR_ZA_MASK; in za_set()
1210 fpsimd_flush_task_state(target); in za_set()
1214 static int zt_get(struct task_struct *target, in zt_get() argument
1225 if (thread_za_enabled(&target->thread)) in zt_get()
1226 membuf_write(&to, thread_zt_state(&target->thread), in zt_get()
1234 static int zt_set(struct task_struct *target, in zt_set() argument
1245 sve_alloc(target, false); in zt_set()
1246 if (!target->thread.sve_state) in zt_set()
1249 if (!thread_za_enabled(&target->thread)) { in zt_set()
1250 sme_alloc(target, true); in zt_set()
1251 if (!target->thread.sme_state) in zt_set()
1256 thread_zt_state(&target->thread), in zt_set()
1259 target->thread.svcr |= SVCR_ZA_MASK; in zt_set()
1260 set_tsk_thread_flag(target, TIF_SME); in zt_set()
1263 fpsimd_flush_task_state(target); in zt_set()
1271 static int pac_mask_get(struct task_struct *target, in pac_mask_get() argument
1292 static int pac_enabled_keys_get(struct task_struct *target, in pac_enabled_keys_get() argument
1296 long enabled_keys = ptrauth_get_enabled_keys(target); in pac_enabled_keys_get()
1304 static int pac_enabled_keys_set(struct task_struct *target, in pac_enabled_keys_set() argument
1310 long enabled_keys = ptrauth_get_enabled_keys(target); in pac_enabled_keys_set()
1320 return ptrauth_set_enabled_keys(target, PR_PAC_ENABLED_KEYS_MASK, in pac_enabled_keys_set()
1358 static int pac_address_keys_get(struct task_struct *target, in pac_address_keys_get() argument
1362 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_address_keys_get()
1373 static int pac_address_keys_set(struct task_struct *target, in pac_address_keys_set() argument
1378 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_address_keys_set()
1407 static int pac_generic_keys_get(struct task_struct *target, in pac_generic_keys_get() argument
1411 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_generic_keys_get()
1422 static int pac_generic_keys_set(struct task_struct *target, in pac_generic_keys_set() argument
1427 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_generic_keys_set()
1447 static int tagged_addr_ctrl_get(struct task_struct *target, in tagged_addr_ctrl_get() argument
1451 long ctrl = get_tagged_addr_ctrl(target); in tagged_addr_ctrl_get()
1459 static int tagged_addr_ctrl_set(struct task_struct *target, const struct in tagged_addr_ctrl_set() argument
1467 ctrl = get_tagged_addr_ctrl(target); in tagged_addr_ctrl_set()
1475 return set_tagged_addr_ctrl(target, ctrl); in tagged_addr_ctrl_set()
1480 static int poe_get(struct task_struct *target, in poe_get() argument
1487 if (target == current) in poe_get()
1490 return membuf_write(&to, &target->thread.por_el0, in poe_get()
1491 sizeof(target->thread.por_el0)); in poe_get()
1494 static int poe_set(struct task_struct *target, const struct in poe_set() argument
1505 ctrl = target->thread.por_el0; in poe_set()
1511 target->thread.por_el0 = ctrl; in poe_set()
1519 const struct task_struct *target) in task_gcs_to_user() argument
1521 user_gcs->features_enabled = target->thread.gcs_el0_mode; in task_gcs_to_user()
1522 user_gcs->features_locked = target->thread.gcs_el0_locked; in task_gcs_to_user()
1523 user_gcs->gcspr_el0 = target->thread.gcspr_el0; in task_gcs_to_user()
1526 static void task_gcs_from_user(struct task_struct *target, in task_gcs_from_user() argument
1529 target->thread.gcs_el0_mode = user_gcs->features_enabled; in task_gcs_from_user()
1530 target->thread.gcs_el0_locked = user_gcs->features_locked; in task_gcs_from_user()
1531 target->thread.gcspr_el0 = user_gcs->gcspr_el0; in task_gcs_from_user()
1534 static int gcs_get(struct task_struct *target, in gcs_get() argument
1543 if (target == current) in gcs_get()
1546 task_gcs_to_user(&user_gcs, target); in gcs_get()
1551 static int gcs_set(struct task_struct *target, const struct in gcs_set() argument
1562 task_gcs_to_user(&user_gcs, target); in gcs_set()
1571 task_gcs_from_user(target, &user_gcs); in gcs_set()
1819 static int compat_gpr_get(struct task_struct *target, in compat_gpr_get() argument
1826 membuf_store(&to, compat_get_user_reg(target, i++)); in compat_gpr_get()
1830 static int compat_gpr_set(struct task_struct *target, in compat_gpr_set() argument
1848 newregs = *task_pt_regs(target); in compat_gpr_set()
1884 if (valid_user_regs(&newregs.user_regs, target)) in compat_gpr_set()
1885 *task_pt_regs(target) = newregs; in compat_gpr_set()
1892 static int compat_vfp_get(struct task_struct *target, in compat_vfp_get() argument
1902 uregs = &target->thread.uw.fpsimd_state; in compat_vfp_get()
1904 if (target == current) in compat_vfp_get()
1917 static int compat_vfp_set(struct task_struct *target, in compat_vfp_set() argument
1929 uregs = &target->thread.uw.fpsimd_state; in compat_vfp_set()
1944 fpsimd_flush_task_state(target); in compat_vfp_set()
1948 static int compat_tls_get(struct task_struct *target, in compat_tls_get() argument
1952 return membuf_store(&to, (compat_ulong_t)target->thread.uw.tp_value); in compat_tls_get()
1955 static int compat_tls_set(struct task_struct *target, in compat_tls_set() argument
1961 compat_ulong_t tls = target->thread.uw.tp_value; in compat_tls_set()
1967 target->thread.uw.tp_value = tls; in compat_tls_set()