nios32: add support for TIF_NOTIFY_SIGNAL
diff mbox series

Message ID c6e927af-7ffd-d087-8716-729e87d80fb1@kernel.dk
State In Next
Commit b88a369957ce04897e88498b09cd6bbcdce9f43e
Headers show
Series
  • nios32: add support for TIF_NOTIFY_SIGNAL
Related show

Commit Message

Jens Axboe Oct. 29, 2020, 4:18 p.m. UTC
Wire up TIF_NOTIFY_SIGNAL handling for nios32.

Cc: Ley Foon Tan <ley.foon.tan@intel.com>
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/nios2/include/asm/thread_info.h | 2 ++
 arch/nios2/kernel/signal.c           | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Tan, Ley Foon Oct. 30, 2020, 12:27 a.m. UTC | #1
> -----Original Message-----
> From: Jens Axboe <axboe@kernel.dk>
> Sent: Friday, October 30, 2020 12:18 AM
> To: Tan, Ley Foon <ley.foon.tan@intel.com>; linux-kernel@vger.kernel.org
> Subject: [PATCH] nios32: add support for TIF_NOTIFY_SIGNAL
> 
> Wire up TIF_NOTIFY_SIGNAL handling for nios32.
> 
> Cc: Ley Foon Tan <ley.foon.tan@intel.com>
> 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/nios2/include/asm/thread_info.h | 2 ++
>  arch/nios2/kernel/signal.c           | 3 ++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/nios2/include/asm/thread_info.h
> b/arch/nios2/include/asm/thread_info.h
> index 7349a4fa635b..272d2c72a727 100644
> --- a/arch/nios2/include/asm/thread_info.h
> +++ b/arch/nios2/include/asm/thread_info.h
> @@ -86,6 +86,7 @@ static inline struct thread_info
> *current_thread_info(void)
>  #define TIF_MEMDIE		4	/* is terminating due to OOM killer */
>  #define TIF_SECCOMP		5	/* secure computing */
>  #define TIF_SYSCALL_AUDIT	6	/* syscall auditing active */
> +#define TIF_NOTIFY_SIGNAL	7	/* signal notifications exist */
>  #define TIF_RESTORE_SIGMASK	9	/* restore signal mask in
> do_signal() */
> 
>  #define TIF_POLLING_NRFLAG	16	/* true if poll_idle() is polling
> @@ -97,6 +98,7 @@ static inline struct thread_info
> *current_thread_info(void)
>  #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
>  #define _TIF_SECCOMP		(1 << TIF_SECCOMP)
>  #define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
> +#define _TIF_NOTIFY_SIGNAL	(1 << TIF_NOTIFY_SIGNAL)
>  #define _TIF_RESTORE_SIGMASK	(1 << TIF_RESTORE_SIGMASK)
>  #define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)
> 
> diff --git a/arch/nios2/kernel/signal.c b/arch/nios2/kernel/signal.c index
> cf2dca2ac7c3..2009ae2d3c3b 100644
> --- a/arch/nios2/kernel/signal.c
> +++ b/arch/nios2/kernel/signal.c
> @@ -306,7 +306,8 @@ asmlinkage int do_notify_resume(struct pt_regs
> *regs)
>  	if (!user_mode(regs))
>  		return 0;
> 
> -	if (test_thread_flag(TIF_SIGPENDING)) {
> +	if (test_thread_flag(TIF_SIGPENDING) ||
> +	    test_thread_flag(TIF_NOTIFY_SIGNAL)) {
>  		int restart = do_signal(regs);
> 
>  		if (unlikely(restart)) {
> --

Please help integrate this patch thru your git tree.

Acked-by: Ley Foon Tan <ley.foon.tan@intel.com>

Regards
Ley Foon
Jens Axboe Oct. 30, 2020, 2:34 a.m. UTC | #2
On 10/29/20 6:27 PM, Tan, Ley Foon wrote:
> Please help integrate this patch thru your git tree.
> 
> Acked-by: Ley Foon Tan <ley.foon.tan@intel.com>

Great - thank you, added.

Patch
diff mbox series

diff --git a/arch/nios2/include/asm/thread_info.h b/arch/nios2/include/asm/thread_info.h
index 7349a4fa635b..272d2c72a727 100644
--- a/arch/nios2/include/asm/thread_info.h
+++ b/arch/nios2/include/asm/thread_info.h
@@ -86,6 +86,7 @@  static inline struct thread_info *current_thread_info(void)
 #define TIF_MEMDIE		4	/* is terminating due to OOM killer */
 #define TIF_SECCOMP		5	/* secure computing */
 #define TIF_SYSCALL_AUDIT	6	/* syscall auditing active */
+#define TIF_NOTIFY_SIGNAL	7	/* signal notifications exist */
 #define TIF_RESTORE_SIGMASK	9	/* restore signal mask in do_signal() */
 
 #define TIF_POLLING_NRFLAG	16	/* true if poll_idle() is polling
@@ -97,6 +98,7 @@  static inline struct thread_info *current_thread_info(void)
 #define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
 #define _TIF_SECCOMP		(1 << TIF_SECCOMP)
 #define _TIF_SYSCALL_AUDIT	(1 << TIF_SYSCALL_AUDIT)
+#define _TIF_NOTIFY_SIGNAL	(1 << TIF_NOTIFY_SIGNAL)
 #define _TIF_RESTORE_SIGMASK	(1 << TIF_RESTORE_SIGMASK)
 #define _TIF_POLLING_NRFLAG	(1 << TIF_POLLING_NRFLAG)
 
diff --git a/arch/nios2/kernel/signal.c b/arch/nios2/kernel/signal.c
index cf2dca2ac7c3..2009ae2d3c3b 100644
--- a/arch/nios2/kernel/signal.c
+++ b/arch/nios2/kernel/signal.c
@@ -306,7 +306,8 @@  asmlinkage int do_notify_resume(struct pt_regs *regs)
 	if (!user_mode(regs))
 		return 0;
 
-	if (test_thread_flag(TIF_SIGPENDING)) {
+	if (test_thread_flag(TIF_SIGPENDING) ||
+	    test_thread_flag(TIF_NOTIFY_SIGNAL)) {
 		int restart = do_signal(regs);
 
 		if (unlikely(restart)) {