Lines Matching refs:task

249 unsigned int task_get_vl(const struct task_struct *task, enum vec_type type)  in task_get_vl()  argument
251 return task->thread.vl[type]; in task_get_vl()
254 void task_set_vl(struct task_struct *task, enum vec_type type, in task_set_vl() argument
257 task->thread.vl[type] = vl; in task_set_vl()
260 unsigned int task_get_vl_onexec(const struct task_struct *task, in task_get_vl_onexec() argument
263 return task->thread.vl_onexec[type]; in task_get_vl_onexec()
266 void task_set_vl_onexec(struct task_struct *task, enum vec_type type, in task_set_vl_onexec() argument
269 task->thread.vl_onexec[type] = vl; in task_set_vl_onexec()
655 static inline void fpsimd_to_sve(struct task_struct *task) in fpsimd_to_sve() argument
658 void *sst = task->thread.sve_state; in fpsimd_to_sve()
659 struct user_fpsimd_state const *fst = &task->thread.uw.fpsimd_state; in fpsimd_to_sve()
664 vq = sve_vq_from_vl(thread_get_cur_vl(&task->thread)); in fpsimd_to_sve()
679 static inline void sve_to_fpsimd(struct task_struct *task) in sve_to_fpsimd() argument
682 void const *sst = task->thread.sve_state; in sve_to_fpsimd()
683 struct user_fpsimd_state *fst = &task->thread.uw.fpsimd_state; in sve_to_fpsimd()
690 vl = thread_get_cur_vl(&task->thread); in sve_to_fpsimd()
706 void task_smstop_sm(struct task_struct *task) in task_smstop_sm() argument
708 if (!thread_sm_enabled(&task->thread)) in task_smstop_sm()
711 __fpsimd_zero_vregs(&task->thread.uw.fpsimd_state); in task_smstop_sm()
712 task->thread.uw.fpsimd_state.fpsr = 0x0800009f; in task_smstop_sm()
714 task->thread.uw.fpmr = 0; in task_smstop_sm()
716 task->thread.svcr &= ~SVCR_SM_MASK; in task_smstop_sm()
717 task->thread.fp_type = FP_STATE_FPSIMD; in task_smstop_sm()
727 static void sve_free(struct task_struct *task) in sve_free() argument
729 kfree(task->thread.sve_state); in sve_free()
730 task->thread.sve_state = NULL; in sve_free()
743 void sve_alloc(struct task_struct *task, bool flush) in sve_alloc() argument
745 if (task->thread.sve_state) { in sve_alloc()
747 memset(task->thread.sve_state, 0, in sve_alloc()
748 sve_state_size(task)); in sve_alloc()
753 task->thread.sve_state = in sve_alloc()
754 kzalloc(sve_state_size(task), GFP_KERNEL); in sve_alloc()
764 void fpsimd_sync_from_effective_state(struct task_struct *task) in fpsimd_sync_from_effective_state() argument
766 if (task->thread.fp_type == FP_STATE_SVE) in fpsimd_sync_from_effective_state()
767 sve_to_fpsimd(task); in fpsimd_sync_from_effective_state()
778 void fpsimd_sync_to_effective_state_zeropad(struct task_struct *task) in fpsimd_sync_to_effective_state_zeropad() argument
781 void *sst = task->thread.sve_state; in fpsimd_sync_to_effective_state_zeropad()
782 struct user_fpsimd_state const *fst = &task->thread.uw.fpsimd_state; in fpsimd_sync_to_effective_state_zeropad()
784 if (task->thread.fp_type != FP_STATE_SVE) in fpsimd_sync_to_effective_state_zeropad()
787 vq = sve_vq_from_vl(thread_get_cur_vl(&task->thread)); in fpsimd_sync_to_effective_state_zeropad()
793 static int change_live_vector_length(struct task_struct *task, in change_live_vector_length() argument
797 unsigned int sve_vl = task_get_sve_vl(task); in change_live_vector_length()
798 unsigned int sme_vl = task_get_sme_vl(task); in change_live_vector_length()
826 if (task == current) in change_live_vector_length()
829 fpsimd_flush_task_state(task); in change_live_vector_length()
835 fpsimd_sync_from_effective_state(task); in change_live_vector_length()
836 task_set_vl(task, type, vl); in change_live_vector_length()
837 kfree(task->thread.sve_state); in change_live_vector_length()
838 task->thread.sve_state = sve_state; in change_live_vector_length()
839 fpsimd_sync_to_effective_state_zeropad(task); in change_live_vector_length()
842 task->thread.svcr &= ~SVCR_ZA_MASK; in change_live_vector_length()
843 kfree(task->thread.sme_state); in change_live_vector_length()
844 task->thread.sme_state = sme_state; in change_live_vector_length()
855 int vec_set_vector_length(struct task_struct *task, enum vec_type type, in vec_set_vector_length() argument
879 if (!onexec && vl != task_get_vl(task, type)) { in vec_set_vector_length()
880 if (change_live_vector_length(task, type, vl)) in vec_set_vector_length()
885 task_set_vl_onexec(task, type, vl); in vec_set_vector_length()
888 task_set_vl_onexec(task, type, 0); in vec_set_vector_length()
890 update_tsk_thread_flag(task, vec_vl_inherit_flag(type), in vec_set_vector_length()
1202 void sme_alloc(struct task_struct *task, bool flush) in sme_alloc() argument
1204 if (task->thread.sme_state) { in sme_alloc()
1206 memset(task->thread.sme_state, 0, in sme_alloc()
1207 sme_state_size(task)); in sme_alloc()
1212 task->thread.sme_state = in sme_alloc()
1213 kzalloc(sme_state_size(task), GFP_KERNEL); in sme_alloc()
1216 static void sme_free(struct task_struct *task) in sme_free() argument
1218 kfree(task->thread.sme_state); in sme_free()
1219 task->thread.sme_state = NULL; in sme_free()
1483 static void fpsimd_load_kernel_state(struct task_struct *task) in fpsimd_load_kernel_state() argument
1491 if (last->st == &task->thread.kernel_fpsimd_state && in fpsimd_load_kernel_state()
1492 task->thread.kernel_fpsimd_cpu == smp_processor_id()) in fpsimd_load_kernel_state()
1495 fpsimd_load_state(&task->thread.kernel_fpsimd_state); in fpsimd_load_kernel_state()
1498 static void fpsimd_save_kernel_state(struct task_struct *task) in fpsimd_save_kernel_state() argument
1501 .st = &task->thread.kernel_fpsimd_state, in fpsimd_save_kernel_state()
1505 fpsimd_save_state(&task->thread.kernel_fpsimd_state); in fpsimd_save_kernel_state()
1508 task->thread.kernel_fpsimd_cpu = smp_processor_id(); in fpsimd_save_kernel_state()