mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] 2.4 force_successful_syscall()
       [not found] <200309101626.48541.bjorn.helgaas@hp.com>
@ 2003-09-17 20:00 ` Marcelo Tosatti
  2003-09-17 21:41   ` Bjorn Helgaas
  2003-09-18  5:42   ` Aneesh Kumar K.V
  0 siblings, 2 replies; 4+ messages in thread
From: Marcelo Tosatti @ 2003-09-17 20:00 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Marcelo Tosatti, linux-ia64, linux-kernel



On Wed, 10 Sep 2003, Bjorn Helgaas wrote:

> Here's a 2.4 backport of this change to 2.5:
> 
>     http://linux.bkbits.net:8080/linux-2.5/cset@1.1046.238.7?nav=index.html
> 
> Alpha, ppc, and sparc64 define force_successful_syscall_return() in 2.5,
> but since it's not obvious to me how to do it correctly in 2.4, I left
> them unchanged.

Whats the reasoning behing this patch?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] 2.4 force_successful_syscall()
  2003-09-17 20:00 ` [PATCH] 2.4 force_successful_syscall() Marcelo Tosatti
@ 2003-09-17 21:41   ` Bjorn Helgaas
  2003-09-18  5:42   ` Aneesh Kumar K.V
  1 sibling, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2003-09-17 21:41 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Marcelo Tosatti, linux-ia64, linux-kernel

On Wednesday 17 September 2003 2:00 pm, Marcelo Tosatti wrote:
> 
> On Wed, 10 Sep 2003, Bjorn Helgaas wrote:
> 
> > Here's a 2.4 backport of this change to 2.5:
> > 
> >     http://linux.bkbits.net:8080/linux-2.5/cset@1.1046.238.7?nav=index.html
> > 
> > Alpha, ppc, and sparc64 define force_successful_syscall_return() in 2.5,
> > but since it's not obvious to me how to do it correctly in 2.4, I left
> > them unchanged.
> 
> Whats the reasoning behing this patch?

Basically we don't want a large unsigned return value to be
misinterpreted as a syscall failure because it looks like
a small negative number.

>From David's description of the 2.5 patch (the link above has
the explanation):

Many architectures (alpha, ia64, ppc, ppc64, sparc, and sparc64 at least)
use a syscall convention which provides for a return value and a separate
error flag.  On those architectures, it can be beneficial if the kernel
provides a mechanism to signal that a syscall call has completed
successfully, even when the returned value is potentially a (small)
negative number.  The patch below provides a hook for such a mechanism via
a macro called force_successful_syscall_return().  On x86, this would be
simply a no-op (because on x86, user-level has to be hacked to handle such
cases).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] 2.4 force_successful_syscall()
  2003-09-17 20:00 ` [PATCH] 2.4 force_successful_syscall() Marcelo Tosatti
  2003-09-17 21:41   ` Bjorn Helgaas
@ 2003-09-18  5:42   ` Aneesh Kumar K.V
  2003-09-18  6:01     ` Aneesh Kumar K.V
  1 sibling, 1 reply; 4+ messages in thread
From: Aneesh Kumar K.V @ 2003-09-18  5:42 UTC (permalink / raw)
  To: Marcelo Tosatti
  Cc: Helgaas, Bjorn (HP), Marcelo Tosatti, linux-ia64, linux-kernel

On Thu, 2003-09-18 at 01:30, Marcelo Tosatti wrote:
> On Wed, 10 Sep 2003, Bjorn Helgaas wrote:
> 
> > Here's a 2.4 backport of this change to 2.5:
> > 
> >
> http://linux.bkbits.net:8080/linux-2.5/cset@1.1046.238.7?nav=index.html
> > 
> > Alpha, ppc, and sparc64 define force_successful_syscall_return() in
> 2.5,
> > but since it's not obvious to me how to do it correctly in 2.4, I left
> > them unchanged.
> 
> Whats the reasoning behing this patch?

IIRC those changes were added to 2.5 by David. Architecture like Ia64
and Alpha support error return via a different register set ( $19 for
Alpha ). But syscalls like ptrace can have negative return value for
successful returns. So in that particular case $19 is forced to be zero
to indicate it is a successful return. IIUC
force_successful_syscall_return  is a wrapper around doing that. On
alpha actually r0 in the stack (regs.r0 ) is made zero which is  read in
entry.S and put in $19. 

-aneesh 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] 2.4 force_successful_syscall()
  2003-09-18  5:42   ` Aneesh Kumar K.V
@ 2003-09-18  6:01     ` Aneesh Kumar K.V
  0 siblings, 0 replies; 4+ messages in thread
From: Aneesh Kumar K.V @ 2003-09-18  6:01 UTC (permalink / raw)
  To: Marcelo Tosatti
  Cc: Helgaas, Bjorn (HP), Marcelo Tosatti, linux-ia64, linux-kernel

On Thu, 2003-09-18 at 11:12, Kumar, Aneesh wrote:
> On Thu, 2003-09-18 at 01:30, Marcelo Tosatti wrote:
> > On Wed, 10 Sep 2003, Bjorn Helgaas wrote:
> > 
> > > Here's a 2.4 backport of this change to 2.5:
> > > 
> > >
> >
> http://linux.bkbits.net:8080/linux-2.5/cset@1.1046.238.7?nav=index.html
> > > 
> > > Alpha, ppc, and sparc64 define force_successful_syscall_return() in
> > 2.5,
> > > but since it's not obvious to me how to do it correctly in 2.4, I
> left
> > > them unchanged.
> > 
> > Whats the reasoning behing this patch?
> 
> IIRC those changes were added to 2.5 by David. Architecture like Ia64
> and Alpha support error return via a different register set ( $19 for
> Alpha ). But syscalls like ptrace can have negative return value for
> successful returns. So in that particular case $19 is forced to be zero
> to indicate it is a successful return. IIUC
> force_successful_syscall_return  is a wrapper around doing that. On
> alpha actually r0 in the stack (regs.r0 ) is made zero which is  read in
> entry.S and put in $19. 


For IA64 I guess it is r10 and regs.r8. May be other can correct me if i
am wrong. 

-aneesh 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-18  5:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200309101626.48541.bjorn.helgaas@hp.com>
2003-09-17 20:00 ` [PATCH] 2.4 force_successful_syscall() Marcelo Tosatti
2003-09-17 21:41   ` Bjorn Helgaas
2003-09-18  5:42   ` Aneesh Kumar K.V
2003-09-18  6:01     ` Aneesh Kumar K.V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®