Commit 6fd84c08 authored by Al Viro's avatar Al Viro

TIF_RESTORE_SIGMASK can be set only when TIF_SIGPENDING is set

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent bf343dfd
...@@ -281,7 +281,7 @@ syscall_exit_work: ...@@ -281,7 +281,7 @@ syscall_exit_work:
ld.w r1, r0[TI_flags] ld.w r1, r0[TI_flags]
rjmp 1b rjmp 1b
2: mov r2, _TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NOTIFY_RESUME 2: mov r2, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME
tst r1, r2 tst r1, r2
breq 3f breq 3f
unmask_interrupts unmask_interrupts
...@@ -587,7 +587,7 @@ fault_exit_work: ...@@ -587,7 +587,7 @@ fault_exit_work:
ld.w r1, r0[TI_flags] ld.w r1, r0[TI_flags]
rjmp fault_exit_work rjmp fault_exit_work
1: mov r2, _TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NOTIFY_RESUME 1: mov r2, _TIF_SIGPENDING | _TIF_NOTIFY_RESUME
tst r1, r2 tst r1, r2
breq 2f breq 2f
unmask_interrupts unmask_interrupts
......
...@@ -303,7 +303,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, struct thread_info *ti) ...@@ -303,7 +303,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, struct thread_info *ti)
if ((sysreg_read(SR) & MODE_MASK) == MODE_SUPERVISOR) if ((sysreg_read(SR) & MODE_MASK) == MODE_SUPERVISOR)
syscall = 1; syscall = 1;
if (ti->flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) if (ti->flags & _TIF_SIGPENDING))
do_signal(regs, syscall); do_signal(regs, syscall);
if (ti->flags & _TIF_NOTIFY_RESUME) { if (ti->flags & _TIF_NOTIFY_RESUME) {
......
...@@ -307,7 +307,7 @@ asmlinkage void do_signal(struct pt_regs *regs) ...@@ -307,7 +307,7 @@ asmlinkage void do_signal(struct pt_regs *regs)
*/ */
asmlinkage void do_notify_resume(struct pt_regs *regs) asmlinkage void do_notify_resume(struct pt_regs *regs)
{ {
if (test_thread_flag(TIF_SIGPENDING) || test_thread_flag(TIF_RESTORE_SIGMASK)) if (test_thread_flag(TIF_SIGPENDING))
do_signal(regs); do_signal(regs);
if (test_thread_flag(TIF_NOTIFY_RESUME)) { if (test_thread_flag(TIF_NOTIFY_RESUME)) {
......
...@@ -711,8 +711,6 @@ ENTRY(_system_call) ...@@ -711,8 +711,6 @@ ENTRY(_system_call)
jump .Lresume_userspace_1; jump .Lresume_userspace_1;
.Lsyscall_sigpending: .Lsyscall_sigpending:
cc = BITTST(r7, TIF_RESTORE_SIGMASK);
if cc jump .Lsyscall_do_signals;
cc = BITTST(r7, TIF_SIGPENDING); cc = BITTST(r7, TIF_SIGPENDING);
if cc jump .Lsyscall_do_signals; if cc jump .Lsyscall_do_signals;
cc = BITTST(r7, TIF_NOTIFY_RESUME); cc = BITTST(r7, TIF_NOTIFY_RESUME);
......
...@@ -335,8 +335,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags, ...@@ -335,8 +335,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags,
int syscall) int syscall)
{ {
/* deal with pending signal delivery */ /* deal with pending signal delivery */
if (thread_info_flags & ((1 << TIF_SIGPENDING) | if (thread_info_flags & (1 << TIF_SIGPENDING))
(1 << TIF_RESTORE_SIGMASK)))
do_signal(regs, syscall); do_signal(regs, syscall);
if (thread_info_flags & (1 << TIF_NOTIFY_RESUME)) { if (thread_info_flags & (1 << TIF_NOTIFY_RESUME)) {
......
...@@ -533,7 +533,7 @@ asmlinkage void do_notify_resume(__u32 thread_info_flags) ...@@ -533,7 +533,7 @@ asmlinkage void do_notify_resume(__u32 thread_info_flags)
clear_thread_flag(TIF_SINGLESTEP); clear_thread_flag(TIF_SINGLESTEP);
/* deal with pending signal delivery */ /* deal with pending signal delivery */
if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) if (thread_info_flags & _TIF_SIGPENDING))
do_signal(); do_signal();
/* deal with notification on about to resume userspace execution */ /* deal with notification on about to resume userspace execution */
......
...@@ -610,7 +610,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused, ...@@ -610,7 +610,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused,
local_irq_enable(); local_irq_enable();
/* deal with pending signal delivery */ /* deal with pending signal delivery */
if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) if (thread_info_flags & _TIF_SIGPENDING)
do_signal(regs); do_signal(regs);
if (thread_info_flags & _TIF_NOTIFY_RESUME) { if (thread_info_flags & _TIF_NOTIFY_RESUME) {
......
...@@ -532,7 +532,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags) ...@@ -532,7 +532,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, u32 thread_info_flags)
} }
/* deal with pending signal delivery */ /* deal with pending signal delivery */
if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) if (thread_info_flags & _TIF_SIGPENDING)
do_signal(regs); do_signal(regs);
if (thread_info_flags & _TIF_NOTIFY_RESUME) { if (thread_info_flags & _TIF_NOTIFY_RESUME) {
......
...@@ -74,7 +74,7 @@ struct thread_info { ...@@ -74,7 +74,7 @@ struct thread_info {
#define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP) #define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP)
#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \ #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | \
_TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK) _TIF_NEED_RESCHED)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -924,7 +924,7 @@ intr_check_sig: ...@@ -924,7 +924,7 @@ intr_check_sig:
/* As above */ /* As above */
mfctl %cr30,%r1 mfctl %cr30,%r1
LDREG TI_FLAGS(%r1),%r19 LDREG TI_FLAGS(%r1),%r19
ldi (_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NOTIFY_RESUME), %r20 ldi (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME), %r20
and,COND(<>) %r19, %r20, %r0 and,COND(<>) %r19, %r20, %r0
b,n intr_restore /* skip past if we've nothing to do */ b,n intr_restore /* skip past if we've nothing to do */
...@@ -2032,7 +2032,7 @@ syscall_check_resched: ...@@ -2032,7 +2032,7 @@ syscall_check_resched:
.import do_signal,code .import do_signal,code
syscall_check_sig: syscall_check_sig:
LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19 LDREG TI_FLAGS-THREAD_SZ_ALGN-FRAME_SIZE(%r30),%r19
ldi (_TIF_SIGPENDING|_TIF_RESTORE_SIGMASK|_TIF_NOTIFY_RESUME), %r26 ldi (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME), %r26
and,COND(<>) %r19, %r26, %r0 and,COND(<>) %r19, %r26, %r0
b,n syscall_restore /* skip past if we've nothing to do */ b,n syscall_restore /* skip past if we've nothing to do */
......
...@@ -613,8 +613,7 @@ do_signal(struct pt_regs *regs, long in_syscall) ...@@ -613,8 +613,7 @@ do_signal(struct pt_regs *regs, long in_syscall)
void do_notify_resume(struct pt_regs *regs, long in_syscall) void do_notify_resume(struct pt_regs *regs, long in_syscall)
{ {
if (test_thread_flag(TIF_SIGPENDING) || if (test_thread_flag(TIF_SIGPENDING))
test_thread_flag(TIF_RESTORE_SIGMASK))
do_signal(regs, in_syscall); do_signal(regs, in_syscall);
if (test_thread_flag(TIF_NOTIFY_RESUME)) { if (test_thread_flag(TIF_NOTIFY_RESUME)) {
......
...@@ -131,8 +131,7 @@ register struct thread_info *current_thread_info_reg asm("g6"); ...@@ -131,8 +131,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \ #define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \
_TIF_SIGPENDING | \ _TIF_SIGPENDING)
_TIF_RESTORE_SIGMASK)
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -567,7 +567,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) ...@@ -567,7 +567,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0,
unsigned long thread_info_flags) unsigned long thread_info_flags)
{ {
if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) if (thread_info_flags & _TIF_SIGPENDING)
do_signal(regs, orig_i0); do_signal(regs, orig_i0);
if (thread_info_flags & _TIF_NOTIFY_RESUME) { if (thread_info_flags & _TIF_NOTIFY_RESUME) {
clear_thread_flag(TIF_NOTIFY_RESUME); clear_thread_flag(TIF_NOTIFY_RESUME);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment