Re: [PATCH v3 00/29] nios2 Linux kernel port

From: Al Viro
Date: Mon Sep 08 2014 - 22:02:36 EST


On Mon, Sep 08, 2014 at 05:22:11PM +0800, Ley Foon Tan wrote:
> This is the 3rd version of patchset adds the Linux kernel port for Nios II processor from
> Altera. All of the feedback from v2 patchseries has been addressed. Thanks to all who
> provided feedback on the previous version.

a) signal caught in rt_sigreturn() (e.g. from change of the set of blocked
signals) should *NOT* trigger syscall restart. IOW, wrt syscall restart
logics, rt_sigreturn() acts as exception, not as a syscall. You are
setting ->orig_r2 to -1, but that doesn't affect your syscall restart
logics.

As the matter of fact, your 'in_syscall' argument is bogus - it's always
1. For return from interrupt as well as that from syscall. And syscall
restart logics _really_ shouldn't apply to return from interrupts - it's
not only wrong, but very hard to debug.

b) multiple pending signals should be all handled before return to
userland. Only the first one might have syscall restart logics triggered.
The effect should be identical to what you'd get if e.g. a timer interrupt
had hit just as you were returning to userland (possibly into handler)
after handling the first one, etc. At the absolute least, SIGSEGV from
failing attempt to build a sigframe should be handled before returning
to userland.

c) rt_sigreturn() should reset ->restart_block.fn to do_no_restart_syscall

d) what's
+ regs->estatus = (regs->estatus & 0xffffffff);
in rt_restore_ucontext() about?

e) restart in handlerless case is better off without leaving the kernel
mode. See what e.g. arm and s390 are doing.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/