csky: add support for TIF_NOTIFY_SIGNAL
PATCH 1/1 csky: add support for TIF_NOTIFY_SIGNAL
Wire up TIF_NOTIFY_SIGNAL handling for csky.
---
5.11 has support queued up for TIF_NOTIFY_SIGNAL, see this posting for details:
https://lore.kernel.org/io-uring/[email protected]/
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(-)
arch/csky/include/asm/thread_info.h +4 -1
@@ -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)
arch/csky/kernel/signal.c +1 -1
@@ -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) {
Signature · 4 lines
2.29.0 -- Jens Axboe
Gentle nudge on this one.
Quoted 64 lines · Jens Axboe
Wire up
TIF_NOTIFY_SIGNALhandling for csky.Signed-off-by Jens Axboe <[email protected]>---
5.11 has support queued up for
TIF_NOTIFY_SIGNAL, see this posting for details:https://lore.kernel.org/io-uring/[email protected]/
As part of that work, I'm adding
TIF_NOTIFY_SIGNALsupport 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(-)arch/csky/include/asm/thread_info.h +4
-1@@ -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)arch/csky/kernel/signal.c +1
-1@@ -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) {
Signature · 1 line
Jens Axboe
I haven't tested the whole patchset of notify_signal, but the wire-up code is ok for me.
Quoted 66 lines · Jens Axboe
Gentle nudge on this one.
Quoted 62 lines · Jens Axboe
Wire up
TIF_NOTIFY_SIGNALhandling for csky.Signed-off-by Jens Axboe <[email protected]>---
5.11 has support queued up for
TIF_NOTIFY_SIGNAL, see this posting for details:https://lore.kernel.org/io-uring/[email protected]/
As part of that work, I'm adding
TIF_NOTIFY_SIGNALsupport 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(-)arch/csky/include/asm/thread_info.h +4
-1@@ -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)arch/csky/kernel/signal.c +1
-1@@ -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);
Quoted 7 lines
arch/csky/kernel/signal.c asmlinkage void do_notify_resume(struct pt_regs *regs, · line 263
Quoted 2 lines
arch/csky/kernel/signal.c +0
-0if (thread_info_flags & _TIF_NOTIFY_RESUME) {--
Jens Axboe
--
Best Regards
Guo Ren
Quoted 4 lines · Guo Ren
I haven't tested the whole patchset of
notify_signal, but the wire-up code is ok for me.Acked-by Guo Ren <[email protected]>
Great thanks, added.
Signature · 1 line
Jens Axboe