Lines Matching refs:t

63 	struct task_struct	*t;  member
173 static notrace bool check_kcov_mode(enum kcov_mode needed_mode, struct task_struct *t) in check_kcov_mode() argument
182 if (!in_task() && !(in_softirq_really() && t->kcov_softirq)) in check_kcov_mode()
184 mode = READ_ONCE(t->kcov_mode); in check_kcov_mode()
210 struct task_struct *t; in __sanitizer_cov_trace_pc() local
215 t = current; in __sanitizer_cov_trace_pc()
216 if (!check_kcov_mode(KCOV_MODE_TRACE_PC, t)) in __sanitizer_cov_trace_pc()
219 area = t->kcov_area; in __sanitizer_cov_trace_pc()
222 if (likely(pos < t->kcov_size)) { in __sanitizer_cov_trace_pc()
240 struct task_struct *t; in write_comp_data() local
244 t = current; in write_comp_data()
245 if (!check_kcov_mode(KCOV_MODE_TRACE_CMP, t)) in write_comp_data()
254 area = (u64 *)t->kcov_area; in write_comp_data()
255 max_pos = t->kcov_size * sizeof(unsigned long); in write_comp_data()
355 static void kcov_start(struct task_struct *t, struct kcov *kcov, in kcov_start() argument
359 kcov_debug("t = %px, size = %u, area = %px\n", t, size, area); in kcov_start()
360 t->kcov = kcov; in kcov_start()
362 t->kcov_size = size; in kcov_start()
363 t->kcov_area = area; in kcov_start()
364 t->kcov_sequence = sequence; in kcov_start()
367 WRITE_ONCE(t->kcov_mode, mode); in kcov_start()
370 static void kcov_stop(struct task_struct *t) in kcov_stop() argument
372 WRITE_ONCE(t->kcov_mode, KCOV_MODE_DISABLED); in kcov_stop()
374 t->kcov = NULL; in kcov_stop()
375 t->kcov_size = 0; in kcov_stop()
376 t->kcov_area = NULL; in kcov_stop()
379 static void kcov_task_reset(struct task_struct *t) in kcov_task_reset() argument
381 kcov_stop(t); in kcov_task_reset()
382 t->kcov_sequence = 0; in kcov_task_reset()
383 t->kcov_handle = 0; in kcov_task_reset()
386 void kcov_task_init(struct task_struct *t) in kcov_task_init() argument
388 kcov_task_reset(t); in kcov_task_init()
389 t->kcov_handle = current->kcov_handle; in kcov_task_init()
394 kcov->t = NULL; in kcov_reset()
420 static void kcov_disable(struct task_struct *t, struct kcov *kcov) in kcov_disable() argument
422 kcov_task_reset(t); in kcov_disable()
443 void kcov_task_exit(struct task_struct *t) in kcov_task_exit() argument
448 kcov = t->kcov; in kcov_task_exit()
453 kcov_debug("t = %px, kcov->t = %px\n", t, kcov->t); in kcov_task_exit()
476 if (WARN_ON(kcov->t != t)) { in kcov_task_exit()
481 kcov_disable(t, kcov); in kcov_task_exit()
587 struct task_struct *t; in kcov_ioctl_locked() local
604 t = current; in kcov_ioctl_locked()
605 if (kcov->t != NULL || t->kcov != NULL) in kcov_ioctl_locked()
612 kcov_start(t, kcov, kcov->size, kcov->area, kcov->mode, in kcov_ioctl_locked()
614 kcov->t = t; in kcov_ioctl_locked()
623 t = current; in kcov_ioctl_locked()
624 if (WARN_ON(kcov->t != t)) in kcov_ioctl_locked()
626 kcov_disable(t, kcov); in kcov_ioctl_locked()
632 t = current; in kcov_ioctl_locked()
633 if (kcov->t != NULL || t->kcov != NULL) in kcov_ioctl_locked()
642 t->kcov = kcov; in kcov_ioctl_locked()
643 t->kcov_mode = KCOV_MODE_REMOTE; in kcov_ioctl_locked()
644 kcov->t = t; in kcov_ioctl_locked()
653 kcov_disable(t, kcov); in kcov_ioctl_locked()
660 kcov_disable(t, kcov); in kcov_ioctl_locked()
669 kcov_disable(t, kcov); in kcov_ioctl_locked()
677 kcov_disable(t, kcov); in kcov_ioctl_locked()
680 t->kcov_handle = remote_arg->common_handle; in kcov_ioctl_locked()
814 static void kcov_remote_softirq_start(struct task_struct *t) in kcov_remote_softirq_start() argument
819 mode = READ_ONCE(t->kcov_mode); in kcov_remote_softirq_start()
823 data->saved_size = t->kcov_size; in kcov_remote_softirq_start()
824 data->saved_area = t->kcov_area; in kcov_remote_softirq_start()
825 data->saved_sequence = t->kcov_sequence; in kcov_remote_softirq_start()
826 data->saved_kcov = t->kcov; in kcov_remote_softirq_start()
827 kcov_stop(t); in kcov_remote_softirq_start()
831 static void kcov_remote_softirq_stop(struct task_struct *t) in kcov_remote_softirq_stop() argument
836 kcov_start(t, data->saved_kcov, data->saved_size, in kcov_remote_softirq_stop()
849 struct task_struct *t = current; in kcov_remote_start() local
869 mode = READ_ONCE(t->kcov_mode); in kcov_remote_start()
879 if (WARN_ON(in_serving_softirq() && t->kcov_softirq)) { in kcov_remote_start()
926 kcov_remote_softirq_start(t); in kcov_remote_start()
927 t->kcov_softirq = 1; in kcov_remote_start()
929 kcov_start(t, kcov, size, area, mode, sequence); in kcov_remote_start()
994 struct task_struct *t = current; in kcov_remote_stop() local
1007 mode = READ_ONCE(t->kcov_mode); in kcov_remote_stop()
1017 if (in_serving_softirq() && !t->kcov_softirq) { in kcov_remote_stop()
1022 if (WARN_ON(!in_serving_softirq() && t->kcov_softirq)) { in kcov_remote_stop()
1027 kcov = t->kcov; in kcov_remote_stop()
1028 area = t->kcov_area; in kcov_remote_stop()
1029 size = t->kcov_size; in kcov_remote_stop()
1030 sequence = t->kcov_sequence; in kcov_remote_stop()
1032 kcov_stop(t); in kcov_remote_stop()
1034 t->kcov_softirq = 0; in kcov_remote_stop()
1035 kcov_remote_softirq_stop(t); in kcov_remote_stop()