On architectures using the generic syscall entry code the architecture independent syscall work is moved to flags in thread_info::syscall_work. This removes architecture dependencies and frees up TIF bits. Define SYSCALL_WORK_SYSCALL_TRACE, use it in the generic entry code and convert the code which uses the TIF specific helper functions to use the new *_syscall_work() helpers which either resolve to the new mode for users of the generic entry code or to the TIF based functions for the other architectures.
Showing the changes to kernel (3 of 7 files). Show all
Unified · Split
| @@ -47,7 +47,7 @@ static long syscall_trace_enter(struct pt_regs *regs, long syscall, · 46 unmodified lines | ||
| 47 | 47 | long ret = 0; |
| 48 | 48 | |
| 49 | 49 | /* Handle ptrace */ |
| 50 | − if (ti_work & (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU)) { | |
| 50 | + if (work & SYSCALL_WORK_SYSCALL_TRACE || ti_work & _TIF_SYSCALL_EMU) { | |
| 51 | 51 | ret = arch_syscall_enter_tracehook(regs); |
| 52 | 52 | if (ret || (ti_work & _TIF_SYSCALL_EMU)) |
| 53 | 53 | return -1L; |
| @@ -237,7 +237,7 @@ static void syscall_exit_work(struct pt_regs *regs, unsigned long ti_work, · 183 unmodified lines | ||
| 237 | 237 | trace_sys_exit(regs, syscall_get_return_value(current, regs)); |
| 238 | 238 | |
| 239 | 239 | step = report_single_step(ti_work); |
| 240 | − if (step || ti_work & _TIF_SYSCALL_TRACE) | |
| 240 | + if (step || work & SYSCALL_WORK_SYSCALL_TRACE) | |
| 241 | 241 | arch_syscall_exit_tracehook(regs, step); |
| 242 | 242 | } |
| 243 | 243 | |
| @@ -2158,7 +2158,7 @@ static __latent_entropy struct task_struct *copy_process( · 2157 unmodified lines | ||
| 2158 | 2158 | * child regardless of CLONE_PTRACE. |
| 2159 | 2159 | */ |
| 2160 | 2160 | user_disable_single_step(p); |
| 2161 | − clear_tsk_thread_flag(p, TIF_SYSCALL_TRACE); | |
| 2161 | + clear_task_syscall_work(p, SYSCALL_TRACE); | |
| 2162 | 2162 | #ifdef TIF_SYSCALL_EMU |
| 2163 | 2163 | clear_tsk_thread_flag(p, TIF_SYSCALL_EMU); |
| 2164 | 2164 | #endif |
| @@ -117,7 +117,7 @@ void __ptrace_unlink(struct task_struct *child) · 116 unmodified lines | ||
| 117 | 117 | const struct cred *old_cred; |
| 118 | 118 | BUG_ON(!child->ptrace); |
| 119 | 119 | |
| 120 | − clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | |
| 120 | + clear_task_syscall_work(child, SYSCALL_TRACE); | |
| 121 | 121 | #ifdef TIF_SYSCALL_EMU |
| 122 | 122 | clear_tsk_thread_flag(child, TIF_SYSCALL_EMU); |
| 123 | 123 | #endif |
| @@ -812,9 +812,9 @@ static int ptrace_resume(struct task_struct *child, long request, · 688 unmodified lines | ||
| 812 | 812 | return -EIO; |
| 813 | 813 | |
| 814 | 814 | if (request == PTRACE_SYSCALL) |
| 815 | − set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | |
| 815 | + set_task_syscall_work(child, SYSCALL_TRACE); | |
| 816 | 816 | else |
| 817 | − clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | |
| 817 | + clear_task_syscall_work(child, SYSCALL_TRACE); | |
| 818 | 818 | |
| 819 | 819 | #ifdef TIF_SYSCALL_EMU |
| 820 | 820 | if (request == PTRACE_SYSEMU || request == PTRACE_SYSEMU_SINGLESTEP) |