Re: [braindump][RFC] signals and syscall restarts (Re: [PATCH v2 19/44] metag: Signal handling)

2012-12-15 Thread Al Viro
On Sat, Dec 15, 2012 at 05:26:30PM +0100, Jonas Bonn wrote: > That said, let me point again to the series I posted for review a year > ago that attempts to make the restart logic more generic: > > https://lkml.org/lkml/2011/10/23/80 > > The entires patch series, which doesn't necessarily even ap

Re: [braindump][RFC] signals and syscall restarts (Re: [PATCH v2 19/44] metag: Signal handling)

2012-12-15 Thread Jonas Bonn
On 8 December 2012 08:44, Al Viro wrote: > On Thu, Dec 06, 2012 at 10:09:55PM +, Al Viro wrote: >> What we need to guarantee is >> * restarts do not happen on signals caught in interrupts or exceptions >> * restarts do not happen on signals caught in sigreturn() >> * restart should happe

Re: [braindump][RFC] signals and syscall restarts (Re: [PATCH v2 19/44] metag: Signal handling)

2012-12-12 Thread James Hogan
On 08/12/12 18:14, Al Viro wrote: > On Thu, Dec 06, 2012 at 10:09:55PM +, Al Viro wrote: > >> What we need to guarantee is >> * restarts do not happen on signals caught in interrupts or exceptions >> * restarts do not happen on signals caught in sigreturn() Since we don't currently have

Re: [braindump][RFC] signals and syscall restarts (Re: [PATCH v2 19/44] metag: Signal handling)

2012-12-10 Thread James Hogan
On 06/12/12 22:09, Al Viro wrote: > On Thu, Dec 06, 2012 at 11:17:34AM +, James Hogan wrote: > >> Agreed, it looks wrong. Looking at the sh version, is there a particular >> reason to only check for -EFAULT and not the other errors that >> do_sigaltstack can return (-EPERM, -EINVAL, and -ENOME

Re: [braindump][RFC] signals and syscall restarts (Re: [PATCH v2 19/44] metag: Signal handling)

2012-12-08 Thread Al Viro
On Thu, Dec 06, 2012 at 10:09:55PM +, Al Viro wrote: > What we need to guarantee is > * restarts do not happen on signals caught in interrupts or exceptions > * restarts do not happen on signals caught in sigreturn() > * restart should happen only once, even if we get through do_signal()

Re: [braindump][RFC] signals and syscall restarts (Re: [PATCH v2 19/44] metag: Signal handling)

2012-12-07 Thread Al Viro
On Thu, Dec 06, 2012 at 10:09:55PM +, Al Viro wrote: > "Subtle and undocumented" is an extremely polite way to describe that. > By now we had at least a dozen architectures step on that trap, simply because > they had different calling conventions and the same logics did *not* "just > wor

[braindump][RFC] signals and syscall restarts (Re: [PATCH v2 19/44] metag: Signal handling)

2012-12-06 Thread Al Viro
On Thu, Dec 06, 2012 at 11:17:34AM +, James Hogan wrote: > Agreed, it looks wrong. Looking at the sh version, is there a particular > reason to only check for -EFAULT and not the other errors that > do_sigaltstack can return (-EPERM, -EINVAL, and -ENOMEM)? See commit fae2ae2a900a5c7bb385fe407

Re: [PATCH v2 19/44] metag: Signal handling

2012-12-06 Thread James Hogan
Hi Al, Thanks for reviewing. On 05/12/12 17:16, Al Viro wrote: >> +if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st))) >> +goto badframe; >> +/* It is more difficult to avoid calling this function than to >> + call it and ignore errors. */ >> +do_sigaltstack

Re: [PATCH v2 19/44] metag: Signal handling

2012-12-05 Thread Al Viro
> + if (__copy_from_user(&st, &frame->uc.uc_stack, sizeof(st))) > + goto badframe; > + /* It is more difficult to avoid calling this function than to > +call it and ignore errors. */ > + do_sigaltstack((__force const stack_t __user *)&st, NULL, regs->REG_SP); "Dear

[PATCH v2 19/44] metag: Signal handling

2012-12-05 Thread James Hogan
Add signal handling code for metag. Signed-off-by: James Hogan --- arch/metag/include/uapi/asm/sigcontext.h | 31 +++ arch/metag/include/uapi/asm/siginfo.h|8 + arch/metag/kernel/signal.c | 345 ++ 3 files changed, 384 insertions(+), 0 deletio