lkml.org 
[lkml]   [2011]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH RFC 2/8] blackfin: implement syscall restart generically
From
Date

On Tue, 2011-10-25 at 20:01 -0400, Mike Frysinger wrote:
> On Sun, Oct 23, 2011 at 06:19, Jonas Bonn <jonas@southpole.se> wrote:
> > --- a/arch/blackfin/include/asm/syscall.h
> > +++ b/arch/blackfin/include/asm/syscall.h
> >
> > static inline long
> > syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
> > {
> > - return regs->p0;
> > + return regs->orig_p0;
> > }
>
> i'm not sure this is correct. we set the orig_p0 to -1 when forcing
> the syscall to go to restart. shouldn't syscall_get_nr() still return
> the right value ?

No, syscall_get_nr is only valid while processing a syscall (should
return -1 otherwise) and the syscall processing is effectively finished
once you've handled the restart requirements so returning -1 at that
point makes sense... patch 1/8 relies on that fact.

>
> > syscall_set_return_value(struct task_struct *task, struct pt_regs *regs,
> > int error, long val)
> > {
> > - regs->r0 = error ? -error : val;
> > + regs->r0 = error ? error : val;
> > }
>
> this fix is unrelated (and unmentioned in the changelog). i also see
> a bunch of other arches doing this. so we should pull this change out
> into a dedicated patchset, and fix all the arches at the same time.

Agreed, this should go into a separate patch. It's true that some
arches do the negation as above, but those arch's return positive error
numbers and indicate syscall error by setting a separate flag. I'll
prepare a separate patch for this.

/Jonas



\
 
 \ /
  Last update: 2011-10-26 08:19    [W:0.511 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site