alpha: unb0rk sigsuspend() and rt_sigsuspend()
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / alpha / kernel / signal.c
blob0f6b51ae865aa87d70c3095cee6cec7057e0834a
1 /*
2 * linux/arch/alpha/kernel/signal.c
4 * Copyright (C) 1995 Linus Torvalds
6 * 1997-11-02 Modified for POSIX.1b signals by Richard Henderson
7 */
9 #include <linux/sched.h>
10 #include <linux/kernel.h>
11 #include <linux/signal.h>
12 #include <linux/errno.h>
13 #include <linux/wait.h>
14 #include <linux/ptrace.h>
15 #include <linux/unistd.h>
16 #include <linux/mm.h>
17 #include <linux/smp.h>
18 #include <linux/stddef.h>
19 #include <linux/tty.h>
20 #include <linux/binfmts.h>
21 #include <linux/bitops.h>
22 #include <linux/syscalls.h>
23 #include <linux/tracehook.h>
25 #include <asm/uaccess.h>
26 #include <asm/sigcontext.h>
27 #include <asm/ucontext.h>
29 #include "proto.h"
32 #define DEBUG_SIG 0
34 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
36 asmlinkage void ret_from_sys_call(void);
37 static void do_signal(struct pt_regs *, struct switch_stack *,
38 unsigned long, unsigned long);
42 * The OSF/1 sigprocmask calling sequence is different from the
43 * C sigprocmask() sequence..
45 * how:
46 * 1 - SIG_BLOCK
47 * 2 - SIG_UNBLOCK
48 * 3 - SIG_SETMASK
50 * We change the range to -1 .. 1 in order to let gcc easily
51 * use the conditional move instructions.
53 * Note that we don't need to acquire the kernel lock for SMP
54 * operation, as all of this is local to this thread.
56 SYSCALL_DEFINE3(osf_sigprocmask, int, how, unsigned long, newmask,
57 struct pt_regs *, regs)
59 unsigned long oldmask = -EINVAL;
61 if ((unsigned long)how-1 <= 2) {
62 long sign = how-2; /* -1 .. 1 */
63 unsigned long block, unblock;
65 newmask &= _BLOCKABLE;
66 spin_lock_irq(&current->sighand->siglock);
67 oldmask = current->blocked.sig[0];
69 unblock = oldmask & ~newmask;
70 block = oldmask | newmask;
71 if (!sign)
72 block = unblock;
73 if (sign <= 0)
74 newmask = block;
75 if (_NSIG_WORDS > 1 && sign > 0)
76 sigemptyset(&current->blocked);
77 current->blocked.sig[0] = newmask;
78 recalc_sigpending();
79 spin_unlock_irq(&current->sighand->siglock);
81 regs->r0 = 0; /* special no error return */
83 return oldmask;
86 SYSCALL_DEFINE3(osf_sigaction, int, sig,
87 const struct osf_sigaction __user *, act,
88 struct osf_sigaction __user *, oact)
90 struct k_sigaction new_ka, old_ka;
91 int ret;
93 if (act) {
94 old_sigset_t mask;
95 if (!access_ok(VERIFY_READ, act, sizeof(*act)) ||
96 __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
97 __get_user(new_ka.sa.sa_flags, &act->sa_flags))
98 return -EFAULT;
99 __get_user(mask, &act->sa_mask);
100 siginitset(&new_ka.sa.sa_mask, mask);
101 new_ka.ka_restorer = NULL;
104 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
106 if (!ret && oact) {
107 if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) ||
108 __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
109 __put_user(old_ka.sa.sa_flags, &oact->sa_flags))
110 return -EFAULT;
111 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
114 return ret;
117 SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act,
118 struct sigaction __user *, oact,
119 size_t, sigsetsize, void __user *, restorer)
121 struct k_sigaction new_ka, old_ka;
122 int ret;
124 /* XXX: Don't preclude handling different sized sigset_t's. */
125 if (sigsetsize != sizeof(sigset_t))
126 return -EINVAL;
128 if (act) {
129 new_ka.ka_restorer = restorer;
130 if (copy_from_user(&new_ka.sa, act, sizeof(*act)))
131 return -EFAULT;
134 ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
136 if (!ret && oact) {
137 if (copy_to_user(oact, &old_ka.sa, sizeof(*oact)))
138 return -EFAULT;
141 return ret;
145 * Atomically swap in the new signal mask, and wait for a signal.
147 SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask)
149 mask &= _BLOCKABLE;
150 spin_lock_irq(&current->sighand->siglock);
151 current->saved_sigmask = current->blocked;
152 siginitset(&current->blocked, mask);
153 recalc_sigpending();
154 spin_unlock_irq(&current->sighand->siglock);
156 current->state = TASK_INTERRUPTIBLE;
157 schedule();
158 set_thread_flag(TIF_RESTORE_SIGMASK);
159 return -ERESTARTNOHAND;
162 asmlinkage int
163 sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss)
165 return do_sigaltstack(uss, uoss, rdusp());
169 * Do a signal return; undo the signal stack.
172 #if _NSIG_WORDS > 1
173 # error "Non SA_SIGINFO frame needs rearranging"
174 #endif
176 struct sigframe
178 struct sigcontext sc;
179 unsigned int retcode[3];
182 struct rt_sigframe
184 struct siginfo info;
185 struct ucontext uc;
186 unsigned int retcode[3];
189 /* If this changes, userland unwinders that Know Things about our signal
190 frame will break. Do not undertake lightly. It also implies an ABI
191 change wrt the size of siginfo_t, which may cause some pain. */
192 extern char compile_time_assert
193 [offsetof(struct rt_sigframe, uc.uc_mcontext) == 176 ? 1 : -1];
195 #define INSN_MOV_R30_R16 0x47fe0410
196 #define INSN_LDI_R0 0x201f0000
197 #define INSN_CALLSYS 0x00000083
199 static long
200 restore_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
201 struct switch_stack *sw)
203 unsigned long usp;
204 long i, err = __get_user(regs->pc, &sc->sc_pc);
206 current_thread_info()->restart_block.fn = do_no_restart_syscall;
208 sw->r26 = (unsigned long) ret_from_sys_call;
210 err |= __get_user(regs->r0, sc->sc_regs+0);
211 err |= __get_user(regs->r1, sc->sc_regs+1);
212 err |= __get_user(regs->r2, sc->sc_regs+2);
213 err |= __get_user(regs->r3, sc->sc_regs+3);
214 err |= __get_user(regs->r4, sc->sc_regs+4);
215 err |= __get_user(regs->r5, sc->sc_regs+5);
216 err |= __get_user(regs->r6, sc->sc_regs+6);
217 err |= __get_user(regs->r7, sc->sc_regs+7);
218 err |= __get_user(regs->r8, sc->sc_regs+8);
219 err |= __get_user(sw->r9, sc->sc_regs+9);
220 err |= __get_user(sw->r10, sc->sc_regs+10);
221 err |= __get_user(sw->r11, sc->sc_regs+11);
222 err |= __get_user(sw->r12, sc->sc_regs+12);
223 err |= __get_user(sw->r13, sc->sc_regs+13);
224 err |= __get_user(sw->r14, sc->sc_regs+14);
225 err |= __get_user(sw->r15, sc->sc_regs+15);
226 err |= __get_user(regs->r16, sc->sc_regs+16);
227 err |= __get_user(regs->r17, sc->sc_regs+17);
228 err |= __get_user(regs->r18, sc->sc_regs+18);
229 err |= __get_user(regs->r19, sc->sc_regs+19);
230 err |= __get_user(regs->r20, sc->sc_regs+20);
231 err |= __get_user(regs->r21, sc->sc_regs+21);
232 err |= __get_user(regs->r22, sc->sc_regs+22);
233 err |= __get_user(regs->r23, sc->sc_regs+23);
234 err |= __get_user(regs->r24, sc->sc_regs+24);
235 err |= __get_user(regs->r25, sc->sc_regs+25);
236 err |= __get_user(regs->r26, sc->sc_regs+26);
237 err |= __get_user(regs->r27, sc->sc_regs+27);
238 err |= __get_user(regs->r28, sc->sc_regs+28);
239 err |= __get_user(regs->gp, sc->sc_regs+29);
240 err |= __get_user(usp, sc->sc_regs+30);
241 wrusp(usp);
243 for (i = 0; i < 31; i++)
244 err |= __get_user(sw->fp[i], sc->sc_fpregs+i);
245 err |= __get_user(sw->fp[31], &sc->sc_fpcr);
247 return err;
250 /* Note that this syscall is also used by setcontext(3) to install
251 a given sigcontext. This because it's impossible to set *all*
252 registers and transfer control from userland. */
254 asmlinkage void
255 do_sigreturn(struct sigcontext __user *sc, struct pt_regs *regs,
256 struct switch_stack *sw)
258 sigset_t set;
260 /* Verify that it's a good sigcontext before using it */
261 if (!access_ok(VERIFY_READ, sc, sizeof(*sc)))
262 goto give_sigsegv;
263 if (__get_user(set.sig[0], &sc->sc_mask))
264 goto give_sigsegv;
266 sigdelsetmask(&set, ~_BLOCKABLE);
267 spin_lock_irq(&current->sighand->siglock);
268 current->blocked = set;
269 recalc_sigpending();
270 spin_unlock_irq(&current->sighand->siglock);
272 if (restore_sigcontext(sc, regs, sw))
273 goto give_sigsegv;
275 /* Send SIGTRAP if we're single-stepping: */
276 if (ptrace_cancel_bpt (current)) {
277 siginfo_t info;
279 info.si_signo = SIGTRAP;
280 info.si_errno = 0;
281 info.si_code = TRAP_BRKPT;
282 info.si_addr = (void __user *) regs->pc;
283 info.si_trapno = 0;
284 send_sig_info(SIGTRAP, &info, current);
286 return;
288 give_sigsegv:
289 force_sig(SIGSEGV, current);
292 asmlinkage void
293 do_rt_sigreturn(struct rt_sigframe __user *frame, struct pt_regs *regs,
294 struct switch_stack *sw)
296 sigset_t set;
298 /* Verify that it's a good ucontext_t before using it */
299 if (!access_ok(VERIFY_READ, &frame->uc, sizeof(frame->uc)))
300 goto give_sigsegv;
301 if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
302 goto give_sigsegv;
304 sigdelsetmask(&set, ~_BLOCKABLE);
305 spin_lock_irq(&current->sighand->siglock);
306 current->blocked = set;
307 recalc_sigpending();
308 spin_unlock_irq(&current->sighand->siglock);
310 if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw))
311 goto give_sigsegv;
313 /* Send SIGTRAP if we're single-stepping: */
314 if (ptrace_cancel_bpt (current)) {
315 siginfo_t info;
317 info.si_signo = SIGTRAP;
318 info.si_errno = 0;
319 info.si_code = TRAP_BRKPT;
320 info.si_addr = (void __user *) regs->pc;
321 info.si_trapno = 0;
322 send_sig_info(SIGTRAP, &info, current);
324 return;
326 give_sigsegv:
327 force_sig(SIGSEGV, current);
332 * Set up a signal frame.
335 static inline void __user *
336 get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size)
338 if ((ka->sa.sa_flags & SA_ONSTACK) != 0 && ! sas_ss_flags(sp))
339 sp = current->sas_ss_sp + current->sas_ss_size;
341 return (void __user *)((sp - frame_size) & -32ul);
344 static long
345 setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
346 struct switch_stack *sw, unsigned long mask, unsigned long sp)
348 long i, err = 0;
350 err |= __put_user(on_sig_stack((unsigned long)sc), &sc->sc_onstack);
351 err |= __put_user(mask, &sc->sc_mask);
352 err |= __put_user(regs->pc, &sc->sc_pc);
353 err |= __put_user(8, &sc->sc_ps);
355 err |= __put_user(regs->r0 , sc->sc_regs+0);
356 err |= __put_user(regs->r1 , sc->sc_regs+1);
357 err |= __put_user(regs->r2 , sc->sc_regs+2);
358 err |= __put_user(regs->r3 , sc->sc_regs+3);
359 err |= __put_user(regs->r4 , sc->sc_regs+4);
360 err |= __put_user(regs->r5 , sc->sc_regs+5);
361 err |= __put_user(regs->r6 , sc->sc_regs+6);
362 err |= __put_user(regs->r7 , sc->sc_regs+7);
363 err |= __put_user(regs->r8 , sc->sc_regs+8);
364 err |= __put_user(sw->r9 , sc->sc_regs+9);
365 err |= __put_user(sw->r10 , sc->sc_regs+10);
366 err |= __put_user(sw->r11 , sc->sc_regs+11);
367 err |= __put_user(sw->r12 , sc->sc_regs+12);
368 err |= __put_user(sw->r13 , sc->sc_regs+13);
369 err |= __put_user(sw->r14 , sc->sc_regs+14);
370 err |= __put_user(sw->r15 , sc->sc_regs+15);
371 err |= __put_user(regs->r16, sc->sc_regs+16);
372 err |= __put_user(regs->r17, sc->sc_regs+17);
373 err |= __put_user(regs->r18, sc->sc_regs+18);
374 err |= __put_user(regs->r19, sc->sc_regs+19);
375 err |= __put_user(regs->r20, sc->sc_regs+20);
376 err |= __put_user(regs->r21, sc->sc_regs+21);
377 err |= __put_user(regs->r22, sc->sc_regs+22);
378 err |= __put_user(regs->r23, sc->sc_regs+23);
379 err |= __put_user(regs->r24, sc->sc_regs+24);
380 err |= __put_user(regs->r25, sc->sc_regs+25);
381 err |= __put_user(regs->r26, sc->sc_regs+26);
382 err |= __put_user(regs->r27, sc->sc_regs+27);
383 err |= __put_user(regs->r28, sc->sc_regs+28);
384 err |= __put_user(regs->gp , sc->sc_regs+29);
385 err |= __put_user(sp, sc->sc_regs+30);
386 err |= __put_user(0, sc->sc_regs+31);
388 for (i = 0; i < 31; i++)
389 err |= __put_user(sw->fp[i], sc->sc_fpregs+i);
390 err |= __put_user(0, sc->sc_fpregs+31);
391 err |= __put_user(sw->fp[31], &sc->sc_fpcr);
393 err |= __put_user(regs->trap_a0, &sc->sc_traparg_a0);
394 err |= __put_user(regs->trap_a1, &sc->sc_traparg_a1);
395 err |= __put_user(regs->trap_a2, &sc->sc_traparg_a2);
397 return err;
400 static int
401 setup_frame(int sig, struct k_sigaction *ka, sigset_t *set,
402 struct pt_regs *regs, struct switch_stack * sw)
404 unsigned long oldsp, r26, err = 0;
405 struct sigframe __user *frame;
407 oldsp = rdusp();
408 frame = get_sigframe(ka, oldsp, sizeof(*frame));
409 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
410 goto give_sigsegv;
412 err |= setup_sigcontext(&frame->sc, regs, sw, set->sig[0], oldsp);
413 if (err)
414 goto give_sigsegv;
416 /* Set up to return from userspace. If provided, use a stub
417 already in userspace. */
418 if (ka->ka_restorer) {
419 r26 = (unsigned long) ka->ka_restorer;
420 } else {
421 err |= __put_user(INSN_MOV_R30_R16, frame->retcode+0);
422 err |= __put_user(INSN_LDI_R0+__NR_sigreturn, frame->retcode+1);
423 err |= __put_user(INSN_CALLSYS, frame->retcode+2);
424 imb();
425 r26 = (unsigned long) frame->retcode;
428 /* Check that everything was written properly. */
429 if (err)
430 goto give_sigsegv;
432 /* "Return" to the handler */
433 regs->r26 = r26;
434 regs->r27 = regs->pc = (unsigned long) ka->sa.sa_handler;
435 regs->r16 = sig; /* a0: signal number */
436 regs->r17 = 0; /* a1: exception code */
437 regs->r18 = (unsigned long) &frame->sc; /* a2: sigcontext pointer */
438 wrusp((unsigned long) frame);
440 #if DEBUG_SIG
441 printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
442 current->comm, current->pid, frame, regs->pc, regs->r26);
443 #endif
445 return 0;
447 give_sigsegv:
448 force_sigsegv(sig, current);
449 return -EFAULT;
452 static int
453 setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
454 sigset_t *set, struct pt_regs *regs, struct switch_stack * sw)
456 unsigned long oldsp, r26, err = 0;
457 struct rt_sigframe __user *frame;
459 oldsp = rdusp();
460 frame = get_sigframe(ka, oldsp, sizeof(*frame));
461 if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
462 goto give_sigsegv;
464 err |= copy_siginfo_to_user(&frame->info, info);
466 /* Create the ucontext. */
467 err |= __put_user(0, &frame->uc.uc_flags);
468 err |= __put_user(0, &frame->uc.uc_link);
469 err |= __put_user(set->sig[0], &frame->uc.uc_osf_sigmask);
470 err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);
471 err |= __put_user(sas_ss_flags(oldsp), &frame->uc.uc_stack.ss_flags);
472 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
473 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, sw,
474 set->sig[0], oldsp);
475 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
476 if (err)
477 goto give_sigsegv;
479 /* Set up to return from userspace. If provided, use a stub
480 already in userspace. */
481 if (ka->ka_restorer) {
482 r26 = (unsigned long) ka->ka_restorer;
483 } else {
484 err |= __put_user(INSN_MOV_R30_R16, frame->retcode+0);
485 err |= __put_user(INSN_LDI_R0+__NR_rt_sigreturn,
486 frame->retcode+1);
487 err |= __put_user(INSN_CALLSYS, frame->retcode+2);
488 imb();
489 r26 = (unsigned long) frame->retcode;
492 if (err)
493 goto give_sigsegv;
495 /* "Return" to the handler */
496 regs->r26 = r26;
497 regs->r27 = regs->pc = (unsigned long) ka->sa.sa_handler;
498 regs->r16 = sig; /* a0: signal number */
499 regs->r17 = (unsigned long) &frame->info; /* a1: siginfo pointer */
500 regs->r18 = (unsigned long) &frame->uc; /* a2: ucontext pointer */
501 wrusp((unsigned long) frame);
503 #if DEBUG_SIG
504 printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n",
505 current->comm, current->pid, frame, regs->pc, regs->r26);
506 #endif
508 return 0;
510 give_sigsegv:
511 force_sigsegv(sig, current);
512 return -EFAULT;
517 * OK, we're invoking a handler.
519 static inline int
520 handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
521 sigset_t *oldset, struct pt_regs * regs, struct switch_stack *sw)
523 int ret;
525 if (ka->sa.sa_flags & SA_SIGINFO)
526 ret = setup_rt_frame(sig, ka, info, oldset, regs, sw);
527 else
528 ret = setup_frame(sig, ka, oldset, regs, sw);
530 if (ret == 0) {
531 spin_lock_irq(&current->sighand->siglock);
532 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
533 if (!(ka->sa.sa_flags & SA_NODEFER))
534 sigaddset(&current->blocked,sig);
535 recalc_sigpending();
536 spin_unlock_irq(&current->sighand->siglock);
539 return ret;
542 static inline void
543 syscall_restart(unsigned long r0, unsigned long r19,
544 struct pt_regs *regs, struct k_sigaction *ka)
546 switch (regs->r0) {
547 case ERESTARTSYS:
548 if (!(ka->sa.sa_flags & SA_RESTART)) {
549 case ERESTARTNOHAND:
550 regs->r0 = EINTR;
551 break;
553 /* fallthrough */
554 case ERESTARTNOINTR:
555 regs->r0 = r0; /* reset v0 and a3 and replay syscall */
556 regs->r19 = r19;
557 regs->pc -= 4;
558 break;
559 case ERESTART_RESTARTBLOCK:
560 regs->r0 = EINTR;
561 break;
567 * Note that 'init' is a special process: it doesn't get signals it doesn't
568 * want to handle. Thus you cannot kill init even with a SIGKILL even by
569 * mistake.
571 * Note that we go through the signals twice: once to check the signals that
572 * the kernel can handle, and then we build all the user-level signal handling
573 * stack-frames in one go after that.
575 * "r0" and "r19" are the registers we need to restore for system call
576 * restart. "r0" is also used as an indicator whether we can restart at
577 * all (if we get here from anything but a syscall return, it will be 0)
579 static void
580 do_signal(struct pt_regs * regs, struct switch_stack * sw,
581 unsigned long r0, unsigned long r19)
583 siginfo_t info;
584 int signr;
585 unsigned long single_stepping = ptrace_cancel_bpt(current);
586 struct k_sigaction ka;
587 sigset_t *oldset;
589 if (test_thread_flag(TIF_RESTORE_SIGMASK))
590 oldset = &current->saved_sigmask;
591 else
592 oldset = &current->blocked;
594 /* This lets the debugger run, ... */
595 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
597 /* ... so re-check the single stepping. */
598 single_stepping |= ptrace_cancel_bpt(current);
600 if (signr > 0) {
601 /* Whee! Actually deliver the signal. */
602 if (r0)
603 syscall_restart(r0, r19, regs, &ka);
604 if (handle_signal(signr, &ka, &info, oldset, regs, sw) == 0) {
605 /* A signal was successfully delivered, and the
606 saved sigmask was stored on the signal frame,
607 and will be restored by sigreturn. So we can
608 simply clear the restore sigmask flag. */
609 if (test_thread_flag(TIF_RESTORE_SIGMASK))
610 clear_thread_flag(TIF_RESTORE_SIGMASK);
612 if (single_stepping)
613 ptrace_set_bpt(current); /* re-set bpt */
614 return;
617 if (r0) {
618 switch (regs->r0) {
619 case ERESTARTNOHAND:
620 case ERESTARTSYS:
621 case ERESTARTNOINTR:
622 /* Reset v0 and a3 and replay syscall. */
623 regs->r0 = r0;
624 regs->r19 = r19;
625 regs->pc -= 4;
626 break;
627 case ERESTART_RESTARTBLOCK:
628 /* Force v0 to the restart syscall and reply. */
629 regs->r0 = __NR_restart_syscall;
630 regs->pc -= 4;
631 break;
635 /* If there's no signal to deliver, we just restore the saved mask. */
636 if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
637 clear_thread_flag(TIF_RESTORE_SIGMASK);
638 sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
641 if (single_stepping)
642 ptrace_set_bpt(current); /* re-set breakpoint */
645 void
646 do_notify_resume(struct pt_regs *regs, struct switch_stack *sw,
647 unsigned long thread_info_flags,
648 unsigned long r0, unsigned long r19)
650 if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK))
651 do_signal(regs, sw, r0, r19);
653 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
654 clear_thread_flag(TIF_NOTIFY_RESUME);
655 tracehook_notify_resume(regs);
656 if (current->replacement_session_keyring)
657 key_replace_session_keyring();