[RFC v14-rc3][PATCH 15/36] c/r of restart-blocks

Oren Laadan orenl at cs.columbia.edu
Tue Apr 7 19:24:05 PDT 2009



Dan Smith wrote:
> OL> +	/* were we from a system call?  if so, get old error/retval */
> OL> +	if (syscall_get_nr(current, regs) >= 0)
> OL> +		ret = syscall_get_error(current, regs);
> 
> OL> The test "were we from a system call ?" is implemented differently
> OL> on the s390, for example. Compare the code in handle_signal(),
> OL> whose logic I follow.
> 
> As far as I can tell, handle_signal() doesn't make that determination
> on s390.  However, do_signal() does:
> 
>   /* Are we from a system call? */
>   if (regs->svcnr) {
> 
> which is identical to the outcome of your code, based on the
> implementation of syscall_get_nr():
> 
>   static inline long syscall_get_nr(struct task_struct *task,
>   				  struct pt_regs *regs)
>   {
>   	return regs->svcnr ? regs->svcnr : -1;
>   }
> 
> Perhaps I need to further study where your function is used to figure
> out what obscure details I'm missing... :)
> 

So my speculation was exactly that - whether or not the code in
{do,handle}_signal() is effectively the same as in the functions
syscall_get_{nr,error}(). I didn't investigate it, but if this
holds true for all architectures, then my code can be safely made
non-arch-dependent (and the arch code for s390 and maybe others
should be fixed to use those functions !).

Oren.


More information about the Containers mailing list