kernel: remove checking for TIF_NOTIFY_SIGNAL
ANBZ: #6478
[ Upstream commit e296dc4996
]
It's available everywhere now, no need to check or add dummy defines.
[backport note]
We added dummy _TIF_NOTIFY_SIGNAL define in 'entry: Add support for
TIF_NOTIFY_SIGNAL'. As it has been defined in arch dirs, this now can be
removed.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Acked-by: Zelin Deng <zelin.deng@linux.alibaba.com>
Acked-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/2195
This commit is contained in:
parent
b807763492
commit
c6cc5e1a78
|
@ -37,10 +37,6 @@
|
|||
# define _TIF_UPROBE (0)
|
||||
#endif
|
||||
|
||||
#ifndef _TIF_NOTIFY_SIGNAL
|
||||
# define _TIF_NOTIFY_SIGNAL (0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* TIF flags handled in syscall_enter_from_user_mode()
|
||||
*/
|
||||
|
|
|
@ -15,10 +15,6 @@
|
|||
# define ARCH_XFER_TO_GUEST_MODE_WORK (0)
|
||||
#endif
|
||||
|
||||
#ifndef _TIF_NOTIFY_SIGNAL
|
||||
# define _TIF_NOTIFY_SIGNAL (0)
|
||||
#endif
|
||||
|
||||
#define XFER_TO_GUEST_MODE_WORK \
|
||||
(_TIF_NEED_RESCHED | _TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL | \
|
||||
_TIF_NOTIFY_RESUME | ARCH_XFER_TO_GUEST_MODE_WORK)
|
||||
|
|
|
@ -366,7 +366,6 @@ static inline int task_sigpending(struct task_struct *p)
|
|||
|
||||
static inline int signal_pending(struct task_struct *p)
|
||||
{
|
||||
#if defined(TIF_NOTIFY_SIGNAL)
|
||||
/*
|
||||
* TIF_NOTIFY_SIGNAL isn't really a signal, but it requires the same
|
||||
* behavior in terms of ensuring that we break out of wait loops
|
||||
|
@ -374,7 +373,6 @@ static inline int signal_pending(struct task_struct *p)
|
|||
*/
|
||||
if (unlikely(test_tsk_thread_flag(p, TIF_NOTIFY_SIGNAL)))
|
||||
return 1;
|
||||
#endif
|
||||
return task_sigpending(p);
|
||||
}
|
||||
|
||||
|
|
|
@ -206,12 +206,10 @@ static inline void tracehook_notify_resume(struct pt_regs *regs)
|
|||
*/
|
||||
static inline void tracehook_notify_signal(void)
|
||||
{
|
||||
#if defined(TIF_NOTIFY_SIGNAL)
|
||||
clear_thread_flag(TIF_NOTIFY_SIGNAL);
|
||||
smp_mb__after_atomic();
|
||||
if (current->task_works)
|
||||
task_work_run();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -219,11 +217,9 @@ static inline void tracehook_notify_signal(void)
|
|||
*/
|
||||
static inline void set_notify_signal(struct task_struct *task)
|
||||
{
|
||||
#if defined(TIF_NOTIFY_SIGNAL)
|
||||
if (!test_and_set_tsk_thread_flag(task, TIF_NOTIFY_SIGNAL) &&
|
||||
!wake_up_state(task, TASK_INTERRUPTIBLE))
|
||||
kick_process(task);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* <linux/tracehook.h> */
|
||||
|
|
|
@ -2526,14 +2526,12 @@ bool get_signal(struct ksignal *ksig)
|
|||
* that the arch handlers don't all have to do it. If we get here
|
||||
* without TIF_SIGPENDING, just exit after running signal work.
|
||||
*/
|
||||
#ifdef TIF_NOTIFY_SIGNAL
|
||||
if (!IS_ENABLED(CONFIG_GENERIC_ENTRY)) {
|
||||
if (test_thread_flag(TIF_NOTIFY_SIGNAL))
|
||||
tracehook_notify_signal();
|
||||
if (!task_sigpending(current))
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (unlikely(uprobe_deny_signal()))
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue