Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95860
b: refs/heads/master
c: 2678fef
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed May 2, 2008
1 parent 3d91ec3 commit 3607d85
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 32039f4954938e4d761032d7046254d08d0db54c
refs/heads/master: 2678fefedbbc03a3ae6f5c254791bf147d6c52fd
6 changes: 0 additions & 6 deletions trunk/arch/sparc64/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,12 +591,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
if (clone_flags & CLONE_SETTLS)
t->kregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3];

/* We do not want to accidently trigger system call restart
* handling in the new thread. Therefore, clear out the trap
* type, which will make pt_regs_regs_is_syscall() return false.
*/
pt_regs_clear_trap_type(t->kregs);

return 0;
}

Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/sparc64/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ void do_rt_sigreturn(struct pt_regs *regs)
regs->tpc = tpc;
regs->tnpc = tnpc;

/* Prevent syscall restart. */
pt_regs_clear_trap_type(regs);

sigdelsetmask(&set, ~_BLOCKABLE);
spin_lock_irq(&current->sighand->siglock);
current->blocked = set;
Expand Down Expand Up @@ -515,7 +518,8 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
siginfo_t info;
int signr;

if (pt_regs_is_syscall(regs)) {
if (pt_regs_is_syscall(regs) &&
(regs->tstate & (TSTATE_XCARRY | TSTATE_ICARRY))) {
pt_regs_clear_trap_type(regs);
cookie.restart_syscall = 1;
} else
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/sparc64/kernel/signal32.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ void do_sigreturn32(struct pt_regs *regs)
regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC);
regs->tstate |= psr_to_tstate_icc(psr);

/* Prevent syscall restart. */
pt_regs_clear_trap_type(regs);

err |= __get_user(fpu_save, &sf->fpu_save);
if (fpu_save)
err |= restore_fpu_state32(regs, &sf->fpu_state);
Expand Down Expand Up @@ -351,6 +354,9 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
regs->tstate &= ~(TSTATE_ICC|TSTATE_XCC);
regs->tstate |= psr_to_tstate_icc(psr);

/* Prevent syscall restart. */
pt_regs_clear_trap_type(regs);

err |= __get_user(fpu_save, &sf->fpu_save);
if (fpu_save)
err |= restore_fpu_state32(regs, &sf->fpu_state);
Expand Down

0 comments on commit 3607d85

Please sign in to comment.