Commit 38ae8676 authored by Jens Axboe's avatar Jens Axboe Committed by sanglipeng
Browse files

nds32: add support for TIF_NOTIFY_SIGNAL

stable inclusion
from stable-v5.10.162
commit 57e833a0a03de1b1d1cfe0db2f9620b50df47502
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7P7OH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=57e833a0a03de1b1d1cfe0db2f9620b50df47502



--------------------------------

[ Upstream commit b13e8bf6 ]

Wire up TIF_NOTIFY_SIGNAL handling for nds32.

Cc: Nick Hu <nickhu@andestech.com>
Cc: Greentime Hu <green.hu@gmail.com>
Cc: Vincent Chen <deanbo422@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent e31b7273
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ struct thread_info {
#define TIF_NEED_RESCHED	2
#define TIF_SINGLESTEP		3
#define TIF_NOTIFY_RESUME	4	/* callback before returning to user */
#define TIF_NOTIFY_SIGNAL	5	/* signal notifications exist */
#define TIF_SYSCALL_TRACE	8
#define TIF_POLLING_NRFLAG	17
#define TIF_MEMDIE		18
@@ -57,6 +58,7 @@ struct thread_info {
#define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
#define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
#define _TIF_NOTIFY_SIGNAL	(1 << TIF_NOTIFY_SIGNAL)
#define _TIF_SINGLESTEP		(1 << TIF_SINGLESTEP)
#define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
#define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)
+1 −1
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ work_pending:
	andi	$p1, $r1, #_TIF_NEED_RESCHED
	bnez	$p1, work_resched

	andi	$p1, $r1, #_TIF_SIGPENDING|#_TIF_NOTIFY_RESUME
	andi	$p1, $r1, #_TIF_SIGPENDING|#_TIF_NOTIFY_RESUME|#_TIF_NOTIFY_SIGNAL
	beqz	$p1, no_work_pending

	move	$r0, $sp			! 'regs'
+1 −1
Original line number Diff line number Diff line
@@ -376,7 +376,7 @@ static void do_signal(struct pt_regs *regs)
asmlinkage void
do_notify_resume(struct pt_regs *regs, unsigned int thread_flags)
{
	if (thread_flags & _TIF_SIGPENDING)
	if (thread_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
		do_signal(regs);

	if (thread_flags & _TIF_NOTIFY_RESUME)