All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonas Bonn <jonas@southpole.se>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	uclinux-dist-devel@blackfin.uclinux.org
Subject: Re: [PATCH RFC 2/8] blackfin: implement syscall restart generically
Date: Wed, 26 Oct 2011 08:16:41 +0200	[thread overview]
Message-ID: <1319609801.2699.118.camel@satguru> (raw)
In-Reply-To: <CAMjpGUeQch6_-wPRVrktLGFt5h3UV3usaD6XHu_gn82DFcEh1Q@mail.gmail.com>


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

  reply	other threads:[~2011-10-26  6:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-23 10:19 [PATCH RFC 0/8] Signal: harmonize syscall restart logic Jonas Bonn
2011-10-23 10:19 ` [PATCH RFC 1/8] signal: introduce generic " Jonas Bonn
2011-10-23 10:19 ` [PATCH RFC 2/8] blackfin: implement syscall restart generically Jonas Bonn
2011-10-26  0:01   ` Mike Frysinger
2011-10-26  6:16     ` Jonas Bonn [this message]
2011-10-26  7:35       ` [uclinux-dist-devel] " Mike Frysinger
2011-10-23 10:19 ` [PATCH RFC 3/8] frv: " Jonas Bonn
2011-10-23 10:19 ` [PATCH RFC 4/8] mips: " Jonas Bonn
2011-11-04  9:32   ` Ralf Baechle
2011-11-04  9:50     ` Jonas Bonn
2011-10-23 10:19 ` [PATCH RFC 5/8] x86: " Jonas Bonn
2011-10-23 10:20 ` [PATCH RFC 6/8] m68k: " Jonas Bonn
2011-10-23 10:20   ` Jonas Bonn
2011-10-23 10:20 ` Jonas Bonn
2011-10-23 10:20 ` [PATCH RFC 7/8] ia64: " Jonas Bonn
2011-10-23 10:20   ` Jonas Bonn
2011-10-23 10:20 ` [PATCH RFC 8/8] tile: " Jonas Bonn
2011-10-31 15:48   ` Chris Metcalf
2011-10-31 15:48     ` Chris Metcalf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1319609801.2699.118.camel@satguru \
    --to=jonas@southpole.se \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=uclinux-dist-devel@blackfin.uclinux.org \
    --cc=vapier.adi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.