diff mbox series

[1/6] alpha: Move __IGNORE* entries to non uapi header

Message ID 1531736638-15294-2-git-send-email-firoz.khan@linaro.org
State New
Headers show
Series System call table generation support | expand

Commit Message

Firoz Khan July 16, 2018, 10:23 a.m. UTC
It is correct to keep __IGNORE* entry in non uapi header
asm/unistd.h while uapi/asm/unistd.h must hold information
only useful for user space applications.

Signed-off-by: Firoz Khan <firoz.khan@linaro.org>

---
 arch/alpha/include/asm/unistd.h      | 5 +++++
 arch/alpha/include/uapi/asm/unistd.h | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.7.4

Comments

Al Viro Aug. 11, 2018, 7:28 p.m. UTC | #1
On Mon, Jul 16, 2018 at 03:53:53PM +0530, Firoz Khan wrote:
> It is correct to keep __IGNORE* entry in non uapi header

> asm/unistd.h while uapi/asm/unistd.h must hold information

> only useful for user space applications.


> diff --git a/arch/alpha/include/uapi/asm/unistd.h b/arch/alpha/include/uapi/asm/unistd.h

> index e153ca6..3bb6ac1 100644

> --- a/arch/alpha/include/uapi/asm/unistd.h

> +++ b/arch/alpha/include/uapi/asm/unistd.h

> @@ -481,9 +481,4 @@

>  #define __NR_pwritev2			521

>  #define __NR_statx			522

>  

> -/* Alpha doesn't have protection keys. */

> -#define __IGNORE_pkey_mprotect

> -#define __IGNORE_pkey_alloc

> -#define __IGNORE_pkey_free

> -

>  #endif /* _UAPI_ALPHA_UNISTD_H */


Hmm...  There's also

#define __IGNORE_alarm
#define __IGNORE_creat
#define __IGNORE_getegid
#define __IGNORE_geteuid
#define __IGNORE_getgid
#define __IGNORE_getpid
#define __IGNORE_getppid
#define __IGNORE_getuid
#define __IGNORE_pause
#define __IGNORE_time
#define __IGNORE_utime
#define __IGNORE_umount2

in there...
Michael Cree Aug. 11, 2018, 8:59 p.m. UTC | #2
On Sat, Aug 11, 2018 at 08:28:04PM +0100, Al Viro wrote:
> On Mon, Jul 16, 2018 at 03:53:53PM +0530, Firoz Khan wrote:

> > It is correct to keep __IGNORE* entry in non uapi header

> > asm/unistd.h while uapi/asm/unistd.h must hold information

> > only useful for user space applications.

> 

> > diff --git a/arch/alpha/include/uapi/asm/unistd.h b/arch/alpha/include/uapi/asm/unistd.h

> > index e153ca6..3bb6ac1 100644

> > --- a/arch/alpha/include/uapi/asm/unistd.h

> > +++ b/arch/alpha/include/uapi/asm/unistd.h

> > @@ -481,9 +481,4 @@

> >  #define __NR_pwritev2			521

> >  #define __NR_statx			522

> >  

> > -/* Alpha doesn't have protection keys. */

> > -#define __IGNORE_pkey_mprotect

> > -#define __IGNORE_pkey_alloc

> > -#define __IGNORE_pkey_free

> > -

> >  #endif /* _UAPI_ALPHA_UNISTD_H */

> 

> Hmm...  There's also

> 

> #define __IGNORE_alarm

> #define __IGNORE_creat


Tell you what, I wouldn't mind if the following ones were actually
implemented as syscalls in the kernel on Alpha:

> #define __IGNORE_getegid

> #define __IGNORE_geteuid

> #define __IGNORE_getgid

> #define __IGNORE_getpid

> #define __IGNORE_getppid

> #define __IGNORE_getuid


There's a growing number of software packages that are deciding
to sideskip glibc and call these syscalls directly.  Supporting
OSF's C ABI incompliant getxpid, etc., in such packages is not
easy and rather intrusive.

Cheers,
Michael.
Arnd Bergmann Aug. 11, 2018, 10:27 p.m. UTC | #3
On Sat, Aug 11, 2018 at 10:59 PM Michael Cree <mcree@orcon.net.nz> wrote:
>

> On Sat, Aug 11, 2018 at 08:28:04PM +0100, Al Viro wrote:

> > On Mon, Jul 16, 2018 at 03:53:53PM +0530, Firoz Khan wrote:

> > > It is correct to keep __IGNORE* entry in non uapi header

> > > asm/unistd.h while uapi/asm/unistd.h must hold information

> > > only useful for user space applications.

> >

> > > diff --git a/arch/alpha/include/uapi/asm/unistd.h b/arch/alpha/include/uapi/asm/unistd.h

> > > index e153ca6..3bb6ac1 100644

> > > --- a/arch/alpha/include/uapi/asm/unistd.h

> > > +++ b/arch/alpha/include/uapi/asm/unistd.h

> > > @@ -481,9 +481,4 @@

> > >  #define __NR_pwritev2                      521

> > >  #define __NR_statx                 522

> > >

> > > -/* Alpha doesn't have protection keys. */

> > > -#define __IGNORE_pkey_mprotect

> > > -#define __IGNORE_pkey_alloc

> > > -#define __IGNORE_pkey_free

> > > -

> > >  #endif /* _UAPI_ALPHA_UNISTD_H */

> >

> > Hmm...  There's also

> >

> > #define __IGNORE_alarm

> > #define __IGNORE_creat

>

> Tell you what, I wouldn't mind if the following ones were actually

> implemented as syscalls in the kernel on Alpha:

>

> > #define __IGNORE_getegid

> > #define __IGNORE_geteuid

> > #define __IGNORE_getgid

> > #define __IGNORE_getpid

> > #define __IGNORE_getppid

> > #define __IGNORE_getuid

>

> There's a growing number of software packages that are deciding

> to sideskip glibc and call these syscalls directly.  Supporting

> OSF's C ABI incompliant getxpid, etc., in such packages is not

> easy and rather intrusive.


That sounds like a good idea to me. It would also help simplify libc
implementations in the long run, as we will probably soon have a
new baseline kernel header version once the y2038 syscalls
are added, with glibc (and maybe others) requiring at leat that
new version as a build time dependency rather than requiring
linux-3.2+ for both headers and runtime.

In a number of years, the latest glibc might then use that same
version again for both the header version and the kernel runtime,
and at that point, it can drop the alpha specific wrapper.

For the other __IGNORE_ entries, I think we can just drop the ones
for alarm, creat, pause, time and utime, as they are already present
in scripts/checksyscalls.sh. __IGNORE_mount2 is still required here,
since alpha calls it __NR_mount rather than __NR_mount2.

    Arnd
diff mbox series

Patch

diff --git a/arch/alpha/include/asm/unistd.h b/arch/alpha/include/asm/unistd.h
index d6e29a1..1d19087 100644
--- a/arch/alpha/include/asm/unistd.h
+++ b/arch/alpha/include/asm/unistd.h
@@ -17,4 +17,9 @@ 
 #define __ARCH_WANT_SYS_VFORK
 #define __ARCH_WANT_SYS_CLONE
 
+/* Alpha doesn't have protection keys. */
+#define __IGNORE_pkey_mprotect
+#define __IGNORE_pkey_alloc
+#define __IGNORE_pkey_free
+
 #endif /* _ALPHA_UNISTD_H */
diff --git a/arch/alpha/include/uapi/asm/unistd.h b/arch/alpha/include/uapi/asm/unistd.h
index e153ca6..3bb6ac1 100644
--- a/arch/alpha/include/uapi/asm/unistd.h
+++ b/arch/alpha/include/uapi/asm/unistd.h
@@ -481,9 +481,4 @@ 
 #define __NR_pwritev2			521
 #define __NR_statx			522
 
-/* Alpha doesn't have protection keys. */
-#define __IGNORE_pkey_mprotect
-#define __IGNORE_pkey_alloc
-#define __IGNORE_pkey_free
-
 #endif /* _UAPI_ALPHA_UNISTD_H */