linux-csky.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] csky: add support for TIF_NOTIFY_SIGNAL
@ 2020-10-29 16:13 Jens Axboe
  2020-11-05 16:19 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2020-10-29 16:13 UTC (permalink / raw)
  To: linux-csky

Wire up TIF_NOTIFY_SIGNAL handling for csky.

Cc: linux-csky@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---

5.11 has support queued up for TIF_NOTIFY_SIGNAL, see this posting
for details:

https://lore.kernel.org/io-uring/20201026203230.386348-1-axboe@kernel.dk/

As part of that work, I'm adding TIF_NOTIFY_SIGNAL support to all archs,
as that will enable a set of cleanups once all of them support it. I'm
happy carrying this patch if need be, or it can be funelled through the
arch tree. Let me know.

 arch/csky/include/asm/thread_info.h | 5 ++++-
 arch/csky/kernel/signal.c           | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/csky/include/asm/thread_info.h b/arch/csky/include/asm/thread_info.h
index 68e7a1227170..21456a3737c2 100644
--- a/arch/csky/include/asm/thread_info.h
+++ b/arch/csky/include/asm/thread_info.h
@@ -64,6 +64,7 @@ static inline struct thread_info *current_thread_info(void)
 #define TIF_SYSCALL_TRACE	4	/* syscall trace active */
 #define TIF_SYSCALL_TRACEPOINT	5       /* syscall tracepoint instrumentation */
 #define TIF_SYSCALL_AUDIT	6	/* syscall auditing */
+#define TIF_NOTIFY_SIGNAL	7	/* signal notifications exist */
 #define TIF_POLLING_NRFLAG	16	/* poll_idle() is TIF_NEED_RESCHED */
 #define TIF_MEMDIE		18      /* is terminating due to OOM killer */
 #define TIF_RESTORE_SIGMASK	20	/* restore signal mask in do_signal() */
@@ -75,6 +76,7 @@ static inline struct thread_info *current_thread_info(void)
 #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
 #define _TIF_SYSCALL_TRACEPOINT	(1 << TIF_SYSCALL_TRACEPOINT)
 #define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
+#define _TIF_NOTIFY_SIGNAL	(1 << TIF_NOTIFY_SIGNAL)
 #define _TIF_UPROBE		(1 << TIF_UPROBE)
 #define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)
 #define _TIF_MEMDIE		(1 << TIF_MEMDIE)
@@ -82,7 +84,8 @@ static inline struct thread_info *current_thread_info(void)
 #define _TIF_SECCOMP		(1 << TIF_SECCOMP)
 
 #define _TIF_WORK_MASK		(_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
-				 _TIF_NOTIFY_RESUME | _TIF_UPROBE)
+				 _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
+				 _TIF_NOTIFY_SIGNAL)
 
 #define _TIF_SYSCALL_WORK	(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
 				 _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP)
diff --git a/arch/csky/kernel/signal.c b/arch/csky/kernel/signal.c
index 8b068cf37447..37ea64ed3c12 100644
--- a/arch/csky/kernel/signal.c
+++ b/arch/csky/kernel/signal.c
@@ -257,7 +257,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
 		uprobe_notify_resume(regs);
 
 	/* Handle pending signal delivery */
-	if (thread_info_flags & _TIF_SIGPENDING)
+	if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
 		do_signal(regs);
 
 	if (thread_info_flags & _TIF_NOTIFY_RESUME) {
-- 
2.29.0

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] csky: add support for TIF_NOTIFY_SIGNAL
  2020-10-29 16:13 [PATCH] csky: add support for TIF_NOTIFY_SIGNAL Jens Axboe
@ 2020-11-05 16:19 ` Jens Axboe
  2020-11-06  1:50   ` Guo Ren
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2020-11-05 16:19 UTC (permalink / raw)
  To: linux-csky

Gentle nudge on this one.

On 10/29/20 10:13 AM, Jens Axboe wrote:
> Wire up TIF_NOTIFY_SIGNAL handling for csky.
> 
> Cc: linux-csky@vger.kernel.org
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
> 
> 5.11 has support queued up for TIF_NOTIFY_SIGNAL, see this posting
> for details:
> 
> https://lore.kernel.org/io-uring/20201026203230.386348-1-axboe@kernel.dk/
> 
> As part of that work, I'm adding TIF_NOTIFY_SIGNAL support to all archs,
> as that will enable a set of cleanups once all of them support it. I'm
> happy carrying this patch if need be, or it can be funelled through the
> arch tree. Let me know.
> 
>  arch/csky/include/asm/thread_info.h | 5 ++++-
>  arch/csky/kernel/signal.c           | 2 +-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/csky/include/asm/thread_info.h b/arch/csky/include/asm/thread_info.h
> index 68e7a1227170..21456a3737c2 100644
> --- a/arch/csky/include/asm/thread_info.h
> +++ b/arch/csky/include/asm/thread_info.h
> @@ -64,6 +64,7 @@ static inline struct thread_info *current_thread_info(void)
>  #define TIF_SYSCALL_TRACE	4	/* syscall trace active */
>  #define TIF_SYSCALL_TRACEPOINT	5       /* syscall tracepoint instrumentation */
>  #define TIF_SYSCALL_AUDIT	6	/* syscall auditing */
> +#define TIF_NOTIFY_SIGNAL	7	/* signal notifications exist */
>  #define TIF_POLLING_NRFLAG	16	/* poll_idle() is TIF_NEED_RESCHED */
>  #define TIF_MEMDIE		18      /* is terminating due to OOM killer */
>  #define TIF_RESTORE_SIGMASK	20	/* restore signal mask in do_signal() */
> @@ -75,6 +76,7 @@ static inline struct thread_info *current_thread_info(void)
>  #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
>  #define _TIF_SYSCALL_TRACEPOINT	(1 << TIF_SYSCALL_TRACEPOINT)
>  #define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
> +#define _TIF_NOTIFY_SIGNAL	(1 << TIF_NOTIFY_SIGNAL)
>  #define _TIF_UPROBE		(1 << TIF_UPROBE)
>  #define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)
>  #define _TIF_MEMDIE		(1 << TIF_MEMDIE)
> @@ -82,7 +84,8 @@ static inline struct thread_info *current_thread_info(void)
>  #define _TIF_SECCOMP		(1 << TIF_SECCOMP)
>  
>  #define _TIF_WORK_MASK		(_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
> -				 _TIF_NOTIFY_RESUME | _TIF_UPROBE)
> +				 _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
> +				 _TIF_NOTIFY_SIGNAL)
>  
>  #define _TIF_SYSCALL_WORK	(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
>  				 _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP)
> diff --git a/arch/csky/kernel/signal.c b/arch/csky/kernel/signal.c
> index 8b068cf37447..37ea64ed3c12 100644
> --- a/arch/csky/kernel/signal.c
> +++ b/arch/csky/kernel/signal.c
> @@ -257,7 +257,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
>  		uprobe_notify_resume(regs);
>  
>  	/* Handle pending signal delivery */
> -	if (thread_info_flags & _TIF_SIGPENDING)
> +	if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
>  		do_signal(regs);
>  
>  	if (thread_info_flags & _TIF_NOTIFY_RESUME) {
> 


-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] csky: add support for TIF_NOTIFY_SIGNAL
  2020-11-05 16:19 ` Jens Axboe
@ 2020-11-06  1:50   ` Guo Ren
  2020-11-06  2:46     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Guo Ren @ 2020-11-06  1:50 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-csky

I haven't tested the whole patchset of notify_signal, but the wire-up
code is ok for me.

Acked-by: Guo Ren <guoren@kernel.org>


On Fri, Nov 6, 2020 at 12:19 AM Jens Axboe <axboe@kernel.dk> wrote:
>
> Gentle nudge on this one.
>
> On 10/29/20 10:13 AM, Jens Axboe wrote:
> > Wire up TIF_NOTIFY_SIGNAL handling for csky.
> >
> > Cc: linux-csky@vger.kernel.org
> > Signed-off-by: Jens Axboe <axboe@kernel.dk>
> > ---
> >
> > 5.11 has support queued up for TIF_NOTIFY_SIGNAL, see this posting
> > for details:
> >
> > https://lore.kernel.org/io-uring/20201026203230.386348-1-axboe@kernel.dk/
> >
> > As part of that work, I'm adding TIF_NOTIFY_SIGNAL support to all archs,
> > as that will enable a set of cleanups once all of them support it. I'm
> > happy carrying this patch if need be, or it can be funelled through the
> > arch tree. Let me know.
> >
> >  arch/csky/include/asm/thread_info.h | 5 ++++-
> >  arch/csky/kernel/signal.c           | 2 +-
> >  2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/csky/include/asm/thread_info.h b/arch/csky/include/asm/thread_info.h
> > index 68e7a1227170..21456a3737c2 100644
> > --- a/arch/csky/include/asm/thread_info.h
> > +++ b/arch/csky/include/asm/thread_info.h
> > @@ -64,6 +64,7 @@ static inline struct thread_info *current_thread_info(void)
> >  #define TIF_SYSCALL_TRACE    4       /* syscall trace active */
> >  #define TIF_SYSCALL_TRACEPOINT       5       /* syscall tracepoint instrumentation */
> >  #define TIF_SYSCALL_AUDIT    6       /* syscall auditing */
> > +#define TIF_NOTIFY_SIGNAL    7       /* signal notifications exist */
> >  #define TIF_POLLING_NRFLAG   16      /* poll_idle() is TIF_NEED_RESCHED */
> >  #define TIF_MEMDIE           18      /* is terminating due to OOM killer */
> >  #define TIF_RESTORE_SIGMASK  20      /* restore signal mask in do_signal() */
> > @@ -75,6 +76,7 @@ static inline struct thread_info *current_thread_info(void)
> >  #define _TIF_SYSCALL_TRACE   (1 << TIF_SYSCALL_TRACE)
> >  #define _TIF_SYSCALL_TRACEPOINT      (1 << TIF_SYSCALL_TRACEPOINT)
> >  #define _TIF_SYSCALL_AUDIT   (1 << TIF_SYSCALL_AUDIT)
> > +#define _TIF_NOTIFY_SIGNAL   (1 << TIF_NOTIFY_SIGNAL)
> >  #define _TIF_UPROBE          (1 << TIF_UPROBE)
> >  #define _TIF_POLLING_NRFLAG  (1 << TIF_POLLING_NRFLAG)
> >  #define _TIF_MEMDIE          (1 << TIF_MEMDIE)
> > @@ -82,7 +84,8 @@ static inline struct thread_info *current_thread_info(void)
> >  #define _TIF_SECCOMP         (1 << TIF_SECCOMP)
> >
> >  #define _TIF_WORK_MASK               (_TIF_NEED_RESCHED | _TIF_SIGPENDING | \
> > -                              _TIF_NOTIFY_RESUME | _TIF_UPROBE)
> > +                              _TIF_NOTIFY_RESUME | _TIF_UPROBE | \
> > +                              _TIF_NOTIFY_SIGNAL)
> >
> >  #define _TIF_SYSCALL_WORK    (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | \
> >                                _TIF_SYSCALL_TRACEPOINT | _TIF_SECCOMP)
> > diff --git a/arch/csky/kernel/signal.c b/arch/csky/kernel/signal.c
> > index 8b068cf37447..37ea64ed3c12 100644
> > --- a/arch/csky/kernel/signal.c
> > +++ b/arch/csky/kernel/signal.c
> > @@ -257,7 +257,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
> >               uprobe_notify_resume(regs);
> >
> >       /* Handle pending signal delivery */
> > -     if (thread_info_flags & _TIF_SIGPENDING)
> > +     if (thread_info_flags & (_TIF_SIGPENDING | _TIF_NOTIFY_SIGNAL))
> >               do_signal(regs);
> >
> >       if (thread_info_flags & _TIF_NOTIFY_RESUME) {
> >
>
>
> --
> Jens Axboe
>


--
Best Regards
 Guo Ren

ML: https://lore.kernel.org/linux-csky/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] csky: add support for TIF_NOTIFY_SIGNAL
  2020-11-06  1:50   ` Guo Ren
@ 2020-11-06  2:46     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2020-11-06  2:46 UTC (permalink / raw)
  To: Guo Ren; +Cc: linux-csky

On 11/5/20 6:50 PM, Guo Ren wrote:
> I haven't tested the whole patchset of notify_signal, but the wire-up
> code is ok for me.
> 
> Acked-by: Guo Ren <guoren@kernel.org>

Great thanks, added.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-06  2:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-29 16:13 [PATCH] csky: add support for TIF_NOTIFY_SIGNAL Jens Axboe
2020-11-05 16:19 ` Jens Axboe
2020-11-06  1:50   ` Guo Ren
2020-11-06  2:46     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).