From: Thomas Gleixner Date: Wed, 4 Nov 2020 17:14:52 +0000 (+0100) Subject: Merge branch 'core/urgent' into core/entry X-Git-Tag: accepted/tizen/unified/20230118.172025~8332^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01be83eea08d6d9f9209843e2e084505fba4053f;p=platform%2Fkernel%2Flinux-rpi.git Merge branch 'core/urgent' into core/entry Pick up the entry fix before further modifications. --- 01be83eea08d6d9f9209843e2e084505fba4053f diff --cc include/linux/entry-common.h index c7bfac4,474f2963..b9711e8 --- a/include/linux/entry-common.h +++ b/include/linux/entry-common.h @@@ -37,12 -37,8 +37,12 @@@ # define _TIF_UPROBE (0) #endif +#ifndef _TIF_NOTIFY_SIGNAL +# define _TIF_NOTIFY_SIGNAL (0) +#endif + /* - * TIF flags handled in syscall_enter_from_usermode() + * TIF flags handled in syscall_enter_from_user_mode() */ #ifndef ARCH_SYSCALL_ENTER_WORK # define ARCH_SYSCALL_ENTER_WORK (0) diff --cc kernel/entry/common.c index f7ed415,e9e2df3..3a1dfec --- a/kernel/entry/common.c +++ b/kernel/entry/common.c @@@ -139,11 -157,10 +165,10 @@@ static unsigned long exit_to_user_mode_ if (ti_work & _TIF_PATCH_PENDING) klp_update_patch_state(current); - if (ti_work & _TIF_SIGPENDING) - arch_do_signal(regs); + if (ti_work & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL)) + handle_signal_work(regs, ti_work); if (ti_work & _TIF_NOTIFY_RESUME) { - clear_thread_flag(TIF_NOTIFY_RESUME); tracehook_notify_resume(regs); rseq_handle_notify_resume(NULL, regs); } diff --cc kernel/task_work.c index ae05889,8d6e121..15b0872 --- a/kernel/task_work.c +++ b/kernel/task_work.c @@@ -52,10 -29,11 +57,10 @@@ static void task_work_notify_signal(str * RETURNS: * 0 if succeeds or -ESRCH. */ - int - task_work_add(struct task_struct *task, struct callback_head *work, int notify) + int task_work_add(struct task_struct *task, struct callback_head *work, + enum task_work_notify_mode notify) { struct callback_head *head; - unsigned long flags; do { head = READ_ONCE(task->task_works); @@@ -69,8 -49,21 +76,11 @@@ set_notify_resume(task); break; case TWA_SIGNAL: - /* - * Only grab the sighand lock if we don't already have some - * task_work pending. This pairs with the smp_store_mb() - * in get_signal(), see comment there. - */ - if (!(READ_ONCE(task->jobctl) & JOBCTL_TASK_WORK) && - lock_task_sighand(task, &flags)) { - task->jobctl |= JOBCTL_TASK_WORK; - signal_wake_up(task, 0); - unlock_task_sighand(task, &flags); - } + task_work_notify_signal(task); break; + default: + WARN_ON_ONCE(1); + break; } return 0;