Skip to content

Commit 4a22709

Browse files
committed
Merge tag 'arch-cleanup-2020-10-22' of git://git.kernel.dk/linux-block
Pull arch task_work cleanups from Jens Axboe: "Two cleanups that don't fit other categories: - Finally get the task_work_add() cleanup done properly, so we don't have random 0/1/false/true/TWA_SIGNAL confusing use cases. Updates all callers, and also fixes up the documentation for task_work_add(). - While working on some TIF related changes for 5.11, this TIF_NOTIFY_RESUME cleanup fell out of that. Remove some arch duplication for how that is handled" * tag 'arch-cleanup-2020-10-22' of git://git.kernel.dk/linux-block: task_work: cleanup notification modes tracehook: clear TIF_NOTIFY_RESUME in tracehook_notify_resume()
2 parents 0a14d76 + 91989c7 commit 4a22709

41 files changed

Lines changed: 64 additions & 76 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

arch/alpha/kernel/signal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ do_work_pending(struct pt_regs *regs, unsigned long thread_flags,
531531
do_signal(regs, r0, r19);
532532
r0 = 0;
533533
} else {
534-
clear_thread_flag(TIF_NOTIFY_RESUME);
535534
tracehook_notify_resume(regs);
536535
}
537536
}

arch/arc/kernel/signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,6 @@ void do_notify_resume(struct pt_regs *regs)
394394
* ASM glue gaurantees that this is only called when returning to
395395
* user mode
396396
*/
397-
if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME))
397+
if (test_thread_flag(TIF_NOTIFY_RESUME))
398398
tracehook_notify_resume(regs);
399399
}

arch/arm/kernel/signal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,6 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
669669
} else if (thread_flags & _TIF_UPROBE) {
670670
uprobe_notify_resume(regs);
671671
} else {
672-
clear_thread_flag(TIF_NOTIFY_RESUME);
673672
tracehook_notify_resume(regs);
674673
rseq_handle_notify_resume(NULL, regs);
675674
}

arch/arm64/kernel/signal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,6 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
946946
do_signal(regs);
947947

948948
if (thread_flags & _TIF_NOTIFY_RESUME) {
949-
clear_thread_flag(TIF_NOTIFY_RESUME);
950949
tracehook_notify_resume(regs);
951950
rseq_handle_notify_resume(NULL, regs);
952951
}

arch/c6x/kernel/signal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,6 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags,
316316
if (thread_info_flags & (1 << TIF_SIGPENDING))
317317
do_signal(regs, syscall);
318318

319-
if (thread_info_flags & (1 << TIF_NOTIFY_RESUME)) {
320-
clear_thread_flag(TIF_NOTIFY_RESUME);
319+
if (thread_info_flags & (1 << TIF_NOTIFY_RESUME))
321320
tracehook_notify_resume(regs);
322-
}
323321
}

arch/csky/kernel/signal.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
261261
do_signal(regs);
262262

263263
if (thread_info_flags & _TIF_NOTIFY_RESUME) {
264-
clear_thread_flag(TIF_NOTIFY_RESUME);
265264
tracehook_notify_resume(regs);
266265
rseq_handle_notify_resume(NULL, regs);
267266
}

arch/h8300/kernel/signal.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,6 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags)
282282
if (thread_info_flags & _TIF_SIGPENDING)
283283
do_signal(regs);
284284

285-
if (thread_info_flags & _TIF_NOTIFY_RESUME) {
286-
clear_thread_flag(TIF_NOTIFY_RESUME);
285+
if (thread_info_flags & _TIF_NOTIFY_RESUME)
287286
tracehook_notify_resume(regs);
288-
}
289287
}

arch/hexagon/kernel/process.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
180180
}
181181

182182
if (thread_info_flags & _TIF_NOTIFY_RESUME) {
183-
clear_thread_flag(TIF_NOTIFY_RESUME);
184183
tracehook_notify_resume(regs);
185184
return 1;
186185
}

arch/ia64/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ do_notify_resume_user(sigset_t *unused, struct sigscratch *scr, long in_syscall)
176176
ia64_do_signal(scr, in_syscall);
177177
}
178178

179-
if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME)) {
179+
if (test_thread_flag(TIF_NOTIFY_RESUME)) {
180180
local_irq_enable(); /* force interrupt enable */
181181
tracehook_notify_resume(&scr->pt);
182182
}

arch/m68k/kernel/signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,6 @@ void do_notify_resume(struct pt_regs *regs)
11361136
if (test_thread_flag(TIF_SIGPENDING))
11371137
do_signal(regs);
11381138

1139-
if (test_and_clear_thread_flag(TIF_NOTIFY_RESUME))
1139+
if (test_thread_flag(TIF_NOTIFY_RESUME))
11401140
tracehook_notify_resume(regs);
11411141
}

0 commit comments

Comments
 (0)