RE: Regarding select() on PPC

6 messages, 3 authors, 2008-09-23 · open the first message on its own page

RE: Regarding select() on PPC

From: Sadashiiv, Halesh <hidden>
Date: 2008-09-23 05:01:15

-----Original Message-----
From: Benjamin Herrenschmidt [mailto:benh@kernel.crashing.org]
Sent: Tuesday, September 23, 2008 10:26 AM
To: Sadashiiv, Halesh
Cc: Josh Boyer; <redacted>
Subject: RE: Regarding select() on PPC

On Tue, 2008-09-23 at 10:20 +0530, Sadashiiv, Halesh wrote:
quoted
Hi,

The below testcase requires to exit with setting errno as EINVAL, as
per
quoted
the man page.

I tested this on ARM, I686, PPC64 it was fine, for the same on PPC32
it
quoted
used exit with errno set as EFAULT.

On further investigation found there was some long obsolete code in
arch/powerpc/kernel/syscalls.c (function ppc_select()), which was
written in 2.2.0 kernel for PPC32 specific , which resulted in
EFAULT.
quoted
This needs to be verified, I have proposed patch for PPC32, Please
check
quoted
the link
http://article.gmane.org/gmane.linux.kernel/735922
I'm trying to sort out how obsolete it actually is and see if we can
remove the whole thing.
Ok...once you verified please let me know.

Your patch should be submitted to the linuxppc-dev mailing list btw.
Will do that.
Ben.
Thanks,
Halesh


-------------------------------------------------------------------
This email is confidential and intended only for the use of the =
individual or entity named above and may contain information that is =
privileged. If you are not the intended recipient, you are notified that =
any dissemination, distribution or copying of this email is strictly =
prohibited. If you have received this email in error, please notify us =
immediately by return email or telephone and destroy the original =
message. - This mail is sent via Sony Asia Pacific Mail Gateway.
-------------------------------------------------------------------

RE: Regarding select() on PPC

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-09-23 05:11:11

quoted
Your patch should be submitted to the linuxppc-dev mailing list btw.
Will do that.
Don't bother for now. The right approach would be to just
get rid of the wrappers I believe. I'm sorting that out.

Ben.

Re: Regarding select() on PPC

From: Arnd Bergmann <arnd@arndb.de>
Date: 2008-09-23 05:46:22

On Tuesday 23 September 2008, Sadashiiv, Halesh wrote:
quoted
I'm trying to sort out how obsolete it actually is and see if we can
remove the whole thing.
Ok...once you verified please let me know.
I just did some more research. The bug was introduced with Linux-2.1.48,
the same version in which Pauls name first appeared as the PPC guy
in the MAINTAINERS file, over 11 years ago.

Before that, ppc used to have distinct implementations for oldselect
(__NR_select) and select (__NR__newselect), because initially it shared
the syscall numbers with i386 and that had replaced its oldselect
with newselect in 1.3.0.

In essence, oldselect was already obsolete before it was introduced
in the powerpc architecture, but for obscure reasons, some code
must have confused the two calling conventions, so Cort introduced
the wrapper that could handle either one, and used it for both
syscalls. This of course made it theoretically impossible to ever
fix the implementation without potentially breaking user space one
way or another.

The 32 bit emulation code never implemented a call behind __NR_select
or the oldselect calling conventions, so anything relying on
the legacy behaviour is broken there already.

I would definitely switch over the ppc32 __NR_newselect implementation
to sys_select. For __NR_select, there is no correct solution, the three
options are the current ppc_select, the real sys_select or sys_ni_syscall.
Each of these is broken in different ways, but in practice it will never
be called anyway.

I love archeology.

	Arnd <><

Re: Regarding select() on PPC

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-09-23 05:56:24

On Tue, 2008-09-23 at 07:46 +0200, Arnd Bergmann wrote:
I would definitely switch over the ppc32 __NR_newselect implementation
to sys_select. For __NR_select, there is no correct solution, the three
options are the current ppc_select, the real sys_select or sys_ni_syscall.
Each of these is broken in different ways, but in practice it will never
be called anyway.

I love archeology.
Any idea when glibc got fixed ?

Ben

Re: Regarding select() on PPC

From: Arnd Bergmann <arnd@arndb.de>
Date: 2008-09-23 06:01:45

On Tuesday 23 September 2008, Benjamin Herrenschmidt wrote:
On Tue, 2008-09-23 at 07:46 +0200, Arnd Bergmann wrote:
quoted
I would definitely switch over the ppc32 __NR_newselect implementation
to sys_select. For __NR_select, there is no correct solution, the three
options are the current ppc_select, the real sys_select or sys_ni_syscall.
Each of these is broken in different ways, but in practice it will never
be called anyway.

I love archeology.
Any idea when glibc got fixed ?
No, sorry, I don't have a git history that I can search for that.
I have a strong guess that it would be the end of the last century
though, probably before 2.3.48, since the comment in there already
refers to legacy binaries.

	Arnd <><

Re: Regarding select() on PPC

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2008-09-23 06:30:19

On Tue, 2008-09-23 at 08:01 +0200, Arnd Bergmann wrote:
No, sorry, I don't have a git history that I can search for that.
I have a strong guess that it would be the end of the last century
though, probably before 2.3.48, since the comment in there already
refers to legacy binaries.
Yeah, I'm keen to rip it out.

Ben.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help