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 sve_sync_to_fpsimd(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 sve_sync_to_fpsimd(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 sve_sync_from_fpsimd_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()
780 if (test_tsk_thread_flag(target, TIF_SVE_VL_INHERIT)) in sve_init_header_from_task()
784 if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT)) in sve_init_header_from_task()
793 if (target->thread.fp_type == FP_STATE_FPSIMD) { in sve_init_header_from_task()
800 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
824 sve_init_header_from_task(&header, target, type); in sve_get_common()
829 if (target == current) in sve_get_common()
837 return __fpr_get(target, regset, to); in sve_get_common()
842 membuf_write(&to, target->thread.sve_state, end - start); in sve_get_common()
854 membuf_write(&to, &target->thread.uw.fpsimd_state.fpsr, in sve_get_common()
866 static int sve_get(struct task_struct *target, in sve_get() argument
873 return sve_get_common(target, regset, to, ARM64_VEC_SVE); in sve_get()
876 static int sve_set_common(struct task_struct *target, in sve_set_common() argument
899 ret = vec_set_vector_length(target, type, header.vl, in sve_set_common()
909 vq = sve_vq_from_vl(task_get_vl(target, type)); in sve_set_common()
913 u64 old_svcr = target->thread.svcr; in sve_set_common()
917 target->thread.svcr &= ~SVCR_SM_MASK; in sve_set_common()
920 target->thread.svcr |= SVCR_SM_MASK; in sve_set_common()
926 sme_alloc(target, false); in sve_set_common()
927 set_tsk_thread_flag(target, TIF_SME); in sve_set_common()
939 if (target->thread.svcr != old_svcr) in sve_set_common()
940 sve_alloc(target, true); in sve_set_common()
947 ret = __fpr_set(target, regset, pos, count, kbuf, ubuf, in sve_set_common()
949 clear_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
950 target->thread.fp_type = FP_STATE_FPSIMD; in sve_set_common()
969 sve_alloc(target, true); in sve_set_common()
970 if (!target->thread.sve_state) { in sve_set_common()
972 clear_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
973 target->thread.fp_type = FP_STATE_FPSIMD; in sve_set_common()
978 * Ensure target->thread.sve_state is up to date with target's in sve_set_common()
984 fpsimd_sync_to_sve(target); in sve_set_common()
986 set_tsk_thread_flag(target, TIF_SVE); in sve_set_common()
987 target->thread.fp_type = FP_STATE_SVE; in sve_set_common()
993 target->thread.sve_state, in sve_set_common()
1009 &target->thread.uw.fpsimd_state.fpsr, in sve_set_common()
1013 fpsimd_flush_task_state(target); in sve_set_common()
1017 static int sve_set(struct task_struct *target, in sve_set() argument
1025 return sve_set_common(target, regset, pos, count, kbuf, ubuf, in sve_set()
1033 static int ssve_get(struct task_struct *target, in ssve_get() argument
1040 return sve_get_common(target, regset, to, ARM64_VEC_SME); in ssve_get()
1043 static int ssve_set(struct task_struct *target, in ssve_set() argument
1051 return sve_set_common(target, regset, pos, count, kbuf, ubuf, in ssve_set()
1055 static int za_get(struct task_struct *target, in za_get() argument
1069 if (test_tsk_thread_flag(target, TIF_SME_VL_INHERIT)) in za_get()
1072 header.vl = task_get_sme_vl(target); in za_get()
1078 if (thread_za_enabled(&target->thread)) in za_get()
1088 if (target == current) in za_get()
1092 if (thread_za_enabled(&target->thread)) { in za_get()
1095 membuf_write(&to, target->thread.sme_state, end - start); in za_get()
1104 static int za_set(struct task_struct *target, in za_set() argument
1130 ret = vec_set_vector_length(target, ARM64_VEC_SME, header.vl, in za_set()
1140 vq = sve_vq_from_vl(task_get_sme_vl(target)); in za_set()
1143 if (!target->thread.sve_state) { in za_set()
1144 sve_alloc(target, false); in za_set()
1145 if (!target->thread.sve_state) { in za_set()
1155 sme_alloc(target, !thread_za_enabled(&target->thread)); in za_set()
1156 if (!target->thread.sme_state) in za_set()
1161 target->thread.svcr &= ~SVCR_ZA_MASK; in za_set()
1179 target->thread.sme_state, in za_set()
1185 set_tsk_thread_flag(target, TIF_SME); in za_set()
1186 target->thread.svcr |= SVCR_ZA_MASK; in za_set()
1189 fpsimd_flush_task_state(target); in za_set()
1193 static int zt_get(struct task_struct *target, in zt_get() argument
1204 if (thread_za_enabled(&target->thread)) in zt_get()
1205 membuf_write(&to, thread_zt_state(&target->thread), in zt_get()
1213 static int zt_set(struct task_struct *target, in zt_set() argument
1224 sve_alloc(target, false); in zt_set()
1225 if (!target->thread.sve_state) in zt_set()
1228 if (!thread_za_enabled(&target->thread)) { in zt_set()
1229 sme_alloc(target, true); in zt_set()
1230 if (!target->thread.sme_state) in zt_set()
1235 thread_zt_state(&target->thread), in zt_set()
1238 target->thread.svcr |= SVCR_ZA_MASK; in zt_set()
1239 set_tsk_thread_flag(target, TIF_SME); in zt_set()
1242 fpsimd_flush_task_state(target); in zt_set()
1250 static int pac_mask_get(struct task_struct *target, in pac_mask_get() argument
1271 static int pac_enabled_keys_get(struct task_struct *target, in pac_enabled_keys_get() argument
1275 long enabled_keys = ptrauth_get_enabled_keys(target); in pac_enabled_keys_get()
1283 static int pac_enabled_keys_set(struct task_struct *target, in pac_enabled_keys_set() argument
1289 long enabled_keys = ptrauth_get_enabled_keys(target); in pac_enabled_keys_set()
1299 return ptrauth_set_enabled_keys(target, PR_PAC_ENABLED_KEYS_MASK, in pac_enabled_keys_set()
1337 static int pac_address_keys_get(struct task_struct *target, in pac_address_keys_get() argument
1341 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_address_keys_get()
1352 static int pac_address_keys_set(struct task_struct *target, in pac_address_keys_set() argument
1357 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_address_keys_set()
1386 static int pac_generic_keys_get(struct task_struct *target, in pac_generic_keys_get() argument
1390 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_generic_keys_get()
1401 static int pac_generic_keys_set(struct task_struct *target, in pac_generic_keys_set() argument
1406 struct ptrauth_keys_user *keys = &target->thread.keys_user; in pac_generic_keys_set()
1426 static int tagged_addr_ctrl_get(struct task_struct *target, in tagged_addr_ctrl_get() argument
1430 long ctrl = get_tagged_addr_ctrl(target); in tagged_addr_ctrl_get()
1438 static int tagged_addr_ctrl_set(struct task_struct *target, const struct in tagged_addr_ctrl_set() argument
1446 ctrl = get_tagged_addr_ctrl(target); in tagged_addr_ctrl_set()
1454 return set_tagged_addr_ctrl(target, ctrl); in tagged_addr_ctrl_set()
1459 static int poe_get(struct task_struct *target, in poe_get() argument
1466 return membuf_write(&to, &target->thread.por_el0, in poe_get()
1467 sizeof(target->thread.por_el0)); in poe_get()
1470 static int poe_set(struct task_struct *target, const struct in poe_set() argument
1481 ctrl = target->thread.por_el0; in poe_set()
1487 target->thread.por_el0 = ctrl; in poe_set()
1495 const struct task_struct *target) in task_gcs_to_user() argument
1497 user_gcs->features_enabled = target->thread.gcs_el0_mode; in task_gcs_to_user()
1498 user_gcs->features_locked = target->thread.gcs_el0_locked; in task_gcs_to_user()
1499 user_gcs->gcspr_el0 = target->thread.gcspr_el0; in task_gcs_to_user()
1502 static void task_gcs_from_user(struct task_struct *target, in task_gcs_from_user() argument
1505 target->thread.gcs_el0_mode = user_gcs->features_enabled; in task_gcs_from_user()
1506 target->thread.gcs_el0_locked = user_gcs->features_locked; in task_gcs_from_user()
1507 target->thread.gcspr_el0 = user_gcs->gcspr_el0; in task_gcs_from_user()
1510 static int gcs_get(struct task_struct *target, in gcs_get() argument
1519 if (target == current) in gcs_get()
1522 task_gcs_to_user(&user_gcs, target); in gcs_get()
1527 static int gcs_set(struct task_struct *target, const struct in gcs_set() argument
1538 task_gcs_to_user(&user_gcs, target); in gcs_set()
1547 task_gcs_from_user(target, &user_gcs); in gcs_set()
1795 static int compat_gpr_get(struct task_struct *target, in compat_gpr_get() argument
1802 membuf_store(&to, compat_get_user_reg(target, i++)); in compat_gpr_get()
1806 static int compat_gpr_set(struct task_struct *target, in compat_gpr_set() argument
1824 newregs = *task_pt_regs(target); in compat_gpr_set()
1860 if (valid_user_regs(&newregs.user_regs, target)) in compat_gpr_set()
1861 *task_pt_regs(target) = newregs; in compat_gpr_set()
1868 static int compat_vfp_get(struct task_struct *target, in compat_vfp_get() argument
1878 uregs = &target->thread.uw.fpsimd_state; in compat_vfp_get()
1880 if (target == current) in compat_vfp_get()
1893 static int compat_vfp_set(struct task_struct *target, in compat_vfp_set() argument
1905 uregs = &target->thread.uw.fpsimd_state; in compat_vfp_set()
1920 fpsimd_flush_task_state(target); in compat_vfp_set()
1924 static int compat_tls_get(struct task_struct *target, in compat_tls_get() argument
1928 return membuf_store(&to, (compat_ulong_t)target->thread.uw.tp_value); in compat_tls_get()
1931 static int compat_tls_set(struct task_struct *target, in compat_tls_set() argument
1937 compat_ulong_t tls = target->thread.uw.tp_value; in compat_tls_set()
1943 target->thread.uw.tp_value = tls; in compat_tls_set()