diff mbox series

[RFC,v2,5/5] powerpc/syscalls: Allow none instead of sys_ni_syscall

Message ID 20190116132714.20094-5-mpe@ellerman.id.au (mailing list archive)
State Superseded
Headers show
Series [RFC,v2,1/5] powerpc/syscalls: Use the number when building SPU syscall table | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch warning next/apply_patch Patch failed to apply
snowpatch_ozlabs/apply_patch fail Failed to apply to any branch

Commit Message

Michael Ellerman Jan. 16, 2019, 1:27 p.m. UTC
sys_ni_syscall is the "not-implemented" syscall syscall, which just
returns -ENOSYS.

But unless you know that it's not obvious what it does, and even if
you do know what it means it doesn't stand out that well from other
real syscalls.

So teach the scripts to treat "none" as a synonym for
"sys_ni_syscall". This makes the table more readable.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/kernel/syscalls/syscall.tbl   | 90 +++++++++++-----------
 arch/powerpc/kernel/syscalls/syscalltbl.sh |  4 +
 2 files changed, 49 insertions(+), 45 deletions(-)

v2: Rebase on top of SPU change.

Comments

Arnd Bergmann Jan. 16, 2019, 1:53 p.m. UTC | #1
On Wed, Jan 16, 2019 at 2:27 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> sys_ni_syscall is the "not-implemented" syscall syscall, which just
> returns -ENOSYS.
>
> But unless you know that it's not obvious what it does, and even if
> you do know what it means it doesn't stand out that well from other
> real syscalls.
>
> So teach the scripts to treat "none" as a synonym for
> "sys_ni_syscall". This makes the table more readable.

Hmm, this actually breaks the proposed script to find bugs
in the compat handling, i.e. detecting those that have no
compat handler but only a native one.

> diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl
> index c5907a2dbc86..988a7e29245f 100644
> --- a/arch/powerpc/kernel/syscalls/syscall.tbl
> +++ b/arch/powerpc/kernel/syscalls/syscall.tbl
> @@ -24,28 +24,28 @@
>  14     common  mknod                           sys_mknod
>  15     common  chmod                           sys_chmod
>  16     common  lchown                          sys_lchown
> -17     common  break                           sys_ni_syscall
> -18     32      oldstat                         sys_stat                        sys_ni_syscall
> -18     64      oldstat                         sys_ni_syscall
> +17     common  break                           none
> +18     32      oldstat                         sys_stat                        none
> +18     64      oldstat                         none

The '64 oldstat' line can simply get dropped here, it has no value
(I failed to notice this earlier).

For break, i.e. a syscall number without any implementation,
we use a different syntax on x86 (leaving out the sys_* entirely),
and on s390 (using '-', which is visually better than 'none' IMHO).

We might also just remove those entirely across all architectures.
Some have already done this, and some have done it partially.
I can only see a couple of syscalls that got removed in the entire
git history (set_zone_reclaim, nfsservctl, vm86, timerfd), any other
ones are now literally pre-historic, and presumably nobody would
miss the macros when building a program that has no chance to
run on any kernel since at least 2.6.12.

For 32-bit oldstat, I'd argue that this should actually get fixed by adding
the compat syscall logic. I think this was discussed when Firoz
first posted his patches. Something like this:

diff --git a/arch/powerpc/include/asm/unistd.h
b/arch/powerpc/include/asm/unistd.h
index f44dbc65e38e..d954c2fc4e2f 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -41,9 +41,7 @@
 #define __ARCH_WANT_SYS_OLDUMOUNT
 #define __ARCH_WANT_SYS_SIGPENDING
 #define __ARCH_WANT_SYS_SIGPROCMASK
-#ifdef CONFIG_PPC32
 #define __ARCH_WANT_OLD_STAT
-#endif
 #ifdef CONFIG_PPC64
 #define __ARCH_WANT_SYS_TIME
 #define __ARCH_WANT_SYS_UTIME
diff --git a/arch/powerpc/include/uapi/asm/stat.h
b/arch/powerpc/include/uapi/asm/stat.h
index afd25f2ff4e8..8331b350c12b 100644
--- a/arch/powerpc/include/uapi/asm/stat.h
+++ b/arch/powerpc/include/uapi/asm/stat.h
@@ -11,7 +11,7 @@

 #define STAT_HAVE_NSEC 1

-#ifndef __powerpc64__
+#if defined(__KERNEL__) || !defined(__powerpc64__)
 struct __old_kernel_stat {
        unsigned short st_dev;
        unsigned short st_ino;
@@ -25,7 +25,7 @@ struct __old_kernel_stat {
        unsigned long  st_mtime;
        unsigned long  st_ctime;
 };
-#endif /* !__powerpc64__ */
+#endif /* __KERNEL__ || !__powerpc64__ */

 struct stat {
        unsigned long   st_dev;
diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl
b/arch/powerpc/kernel/syscalls/syscall.tbl
index 740dc9dbf689..cd85718c7039 100644
--- a/arch/powerpc/kernel/syscalls/syscall.tbl
+++ b/arch/powerpc/kernel/syscalls/syscall.tbl
@@ -27,7 +27,7 @@
 15     common  chmod                           sys_chmod
 16     common  lchown                          sys_lchown
 17     common  break                           sys_ni_syscall
-18     32      oldstat                         sys_stat
         sys_ni_syscall
+18     32      oldstat                         sys_stat
 18     64      oldstat                         sys_ni_syscall
 18     spu     oldstat                         sys_ni_syscall
 19     common  lseek                           sys_lseek
         compat_sys_lseek
@@ -43,7 +43,7 @@
 25     spu     stime                           sys_stime
 26     nospu   ptrace                          sys_ptrace
         compat_sys_ptrace
 27     common  alarm                           sys_alarm
-28     32      oldfstat                        sys_fstat
         sys_ni_syscall
+28     32      oldfstat                        sys_fstat
 28     64      oldfstat                        sys_ni_syscall
 28     spu     oldfstat                        sys_ni_syscall
 29     nospu   pause                           sys_pause
@@ -114,7 +114,7 @@
 82     64      select                          sys_ni_syscall
 82     spu     select                          sys_ni_syscall
 83     common  symlink                         sys_symlink
-84     32      oldlstat                        sys_lstat
         sys_ni_syscall
+84     32      oldlstat                        sys_lstat
 84     64      oldlstat                        sys_ni_syscall
 84     spu     oldlstat                        sys_ni_syscall
 85     common  readlink                        sys_readlink
Michael Ellerman Jan. 17, 2019, 10:35 a.m. UTC | #2
Hi Arnd,

Arnd Bergmann <arnd@arndb.de> writes:
> On Wed, Jan 16, 2019 at 2:27 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>>
>> sys_ni_syscall is the "not-implemented" syscall syscall, which just
>> returns -ENOSYS.
>>
>> But unless you know that it's not obvious what it does, and even if
>> you do know what it means it doesn't stand out that well from other
>> real syscalls.
>>
>> So teach the scripts to treat "none" as a synonym for
>> "sys_ni_syscall". This makes the table more readable.
>
> Hmm, this actually breaks the proposed script to find bugs
> in the compat handling, i.e. detecting those that have no
> compat handler but only a native one.

I don't understand how? It just makes none an alias for sys_ni_syscall,
so surely the worse case is that script will need to do the reverse
transformation?

>> diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl
>> index c5907a2dbc86..988a7e29245f 100644
>> --- a/arch/powerpc/kernel/syscalls/syscall.tbl
>> +++ b/arch/powerpc/kernel/syscalls/syscall.tbl
>> @@ -24,28 +24,28 @@
>>  14     common  mknod                           sys_mknod
>>  15     common  chmod                           sys_chmod
>>  16     common  lchown                          sys_lchown
>> -17     common  break                           sys_ni_syscall
>> -18     32      oldstat                         sys_stat                        sys_ni_syscall
>> -18     64      oldstat                         sys_ni_syscall
>> +17     common  break                           none
>> +18     32      oldstat                         sys_stat                        none
>> +18     64      oldstat                         none
>
> The '64 oldstat' line can simply get dropped here, it has no value
> (I failed to notice this earlier).

It does add value. It causes the syscall number to be defined in
unistd.h (now unistd_64.h).

If you remove it then that syscall number is no longer defined which
changes the uapi header and could break something.

Sure arguably it shouldn't be defined, and it's old etc. but it was
previously defined, so removing it seems risky.


> For break, i.e. a syscall number without any implementation,
> we use a different syntax on x86 (leaving out the sys_* entirely),
> and on s390 (using '-', which is visually better than 'none' IMHO).

Except a blank compat syscall doesn't mean the syscall doesn't exist for
compat tasks, it means they get the non-compat entry point. So blank or
'-' are not explicit enough IMO because the script might have some
default logic which you can't see by looking at the table.

"none" is pretty explicit I thought. Possibly better is a literal
"ENOSYS", which stands out well and should be obvious to new comers.

> We might also just remove those entirely across all architectures.
> Some have already done this, and some have done it partially.
> I can only see a couple of syscalls that got removed in the entire
> git history (set_zone_reclaim, nfsservctl, vm86, timerfd), any other
> ones are now literally pre-historic, and presumably nobody would
> miss the macros when building a program that has no chance to
> run on any kernel since at least 2.6.12.

I don't see the benefit, a single missing #define could be a build break
for some random pieces of software out there.


> For 32-bit oldstat, I'd argue that this should actually get fixed by adding
> the compat syscall logic. I think this was discussed when Firoz
> first posted his patches. Something like this:

I'm not clear why we would do that? If there were programs out there
that wanted oldstat in compat mode surely we would have got a bug report
by now.

So this just wires up a syscall that no one will ever use?

cheers

> diff --git a/arch/powerpc/include/asm/unistd.h
> b/arch/powerpc/include/asm/unistd.h
> index f44dbc65e38e..d954c2fc4e2f 100644
> --- a/arch/powerpc/include/asm/unistd.h
> +++ b/arch/powerpc/include/asm/unistd.h
> @@ -41,9 +41,7 @@
>  #define __ARCH_WANT_SYS_OLDUMOUNT
>  #define __ARCH_WANT_SYS_SIGPENDING
>  #define __ARCH_WANT_SYS_SIGPROCMASK
> -#ifdef CONFIG_PPC32
>  #define __ARCH_WANT_OLD_STAT
> -#endif
>  #ifdef CONFIG_PPC64
>  #define __ARCH_WANT_SYS_TIME
>  #define __ARCH_WANT_SYS_UTIME
> diff --git a/arch/powerpc/include/uapi/asm/stat.h
> b/arch/powerpc/include/uapi/asm/stat.h
> index afd25f2ff4e8..8331b350c12b 100644
> --- a/arch/powerpc/include/uapi/asm/stat.h
> +++ b/arch/powerpc/include/uapi/asm/stat.h
> @@ -11,7 +11,7 @@
>
>  #define STAT_HAVE_NSEC 1
>
> -#ifndef __powerpc64__
> +#if defined(__KERNEL__) || !defined(__powerpc64__)
>  struct __old_kernel_stat {
>         unsigned short st_dev;
>         unsigned short st_ino;
> @@ -25,7 +25,7 @@ struct __old_kernel_stat {
>         unsigned long  st_mtime;
>         unsigned long  st_ctime;
>  };
> -#endif /* !__powerpc64__ */
> +#endif /* __KERNEL__ || !__powerpc64__ */
>
>  struct stat {
>         unsigned long   st_dev;
> diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl
> b/arch/powerpc/kernel/syscalls/syscall.tbl
> index 740dc9dbf689..cd85718c7039 100644
> --- a/arch/powerpc/kernel/syscalls/syscall.tbl
> +++ b/arch/powerpc/kernel/syscalls/syscall.tbl
> @@ -27,7 +27,7 @@
>  15     common  chmod                           sys_chmod
>  16     common  lchown                          sys_lchown
>  17     common  break                           sys_ni_syscall
> -18     32      oldstat                         sys_stat           sys_ni_syscall
> +18     32      oldstat                         sys_stat
>  18     64      oldstat                         sys_ni_syscall
>  18     spu     oldstat                         sys_ni_syscall
>  19     common  lseek                           sys_lseek
>          compat_sys_lseek
> @@ -43,7 +43,7 @@
>  25     spu     stime                           sys_stime
>  26     nospu   ptrace                          sys_ptrace
>          compat_sys_ptrace
>  27     common  alarm                           sys_alarm
> -28     32      oldfstat                        sys_fstat           sys_ni_syscall
> +28     32      oldfstat                        sys_fstat
>  28     64      oldfstat                        sys_ni_syscall
>  28     spu     oldfstat                        sys_ni_syscall
>  29     nospu   pause                           sys_pause
> @@ -114,7 +114,7 @@
>  82     64      select                          sys_ni_syscall
>  82     spu     select                          sys_ni_syscall
>  83     common  symlink                         sys_symlink
> -84     32      oldlstat                        sys_lstat           sys_ni_syscall
> +84     32      oldlstat                        sys_lstat
>  84     64      oldlstat                        sys_ni_syscall
>  84     spu     oldlstat                        sys_ni_syscall
>  85     common  readlink                        sys_readlink
Arnd Bergmann Jan. 17, 2019, 12:21 p.m. UTC | #3
On Thu, Jan 17, 2019 at 11:35 AM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Hi Arnd,
>
> Arnd Bergmann <arnd@arndb.de> writes:
> > On Wed, Jan 16, 2019 at 2:27 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
> >>
> >> sys_ni_syscall is the "not-implemented" syscall syscall, which just
> >> returns -ENOSYS.
> >>
> >> But unless you know that it's not obvious what it does, and even if
> >> you do know what it means it doesn't stand out that well from other
> >> real syscalls.
> >>
> >> So teach the scripts to treat "none" as a synonym for
> >> "sys_ni_syscall". This makes the table more readable.
> >
> > Hmm, this actually breaks the proposed script to find bugs
> > in the compat handling, i.e. detecting those that have no
> > compat handler but only a native one.
>
> I don't understand how? It just makes none an alias for sys_ni_syscall,
> so surely the worse case is that script will need to do the reverse
> transformation?

I mean it's broken to have a common script when architectures do it
differently. It would be fine if you changed all architectures at the same
time though.

> > For break, i.e. a syscall number without any implementation,
> > we use a different syntax on x86 (leaving out the sys_* entirely),
> > and on s390 (using '-', which is visually better than 'none' IMHO).
>
> Except a blank compat syscall doesn't mean the syscall doesn't exist for
> compat tasks, it means they get the non-compat entry point. So blank or
> '-' are not explicit enough IMO because the script might have some
> default logic which you can't see by looking at the table.
>
> "none" is pretty explicit I thought. Possibly better is a literal
> "ENOSYS", which stands out well and should be obvious to new comers.

ENOSYS is fine with me as well, but most importantly please don't make
powerpc different from the other ones for a matter of personal preference.
Whatever you want to change it to, please make the patch change all
syscall.tbl files at once, and explain in the patch why we should do this
across all architectures, then see if anyone objects.

> > We might also just remove those entirely across all architectures.
> > Some have already done this, and some have done it partially.
> > I can only see a couple of syscalls that got removed in the entire
> > git history (set_zone_reclaim, nfsservctl, vm86, timerfd), any other
> > ones are now literally pre-historic, and presumably nobody would
> > miss the macros when building a program that has no chance to
> > run on any kernel since at least 2.6.12.
>
> I don't see the benefit, a single missing #define could be a build break
> for some random pieces of software out there.

It certainly could, the question is whether that is a bad thing or not.

Once again, I think it's most important to be consistent across
architectures, and either define them everywhere or nowhere so we
don't end up with applications that are only broken on less common
architectures but work on fine on others.

Most of these only still exist in a few architectures anyway:

$ git grep sys_ni_syscall arch/{*/,}*/*/syscall*.tbl | grep -v
'\<\(osf\|available\|reserved\|unused\)' | awk '{ print $3; }' | sort
| uniq -c
      7 afs_syscall
      3 break
      8 create_module
      1 dipc
      1 exec_with_loader
      1 fadvise64_64
      3 ftime
      8 get_kernel_syms
      1 get_mempolicy
      7 getpmsg
      3 getrlimit
      1 get_thread_area
      3 gtty
      3 idle
      3 ioperm
      3 iopl
      1 ipc
      1 kern_features
      1 kexec_load
      3 lock
      1 mbind
      1 migrate_pages
      3 modify_ldt
      3 mpx
      1 multiplexer
     11 nfsservctl
      1 ni_syscall
      3 oldfstat
      3 oldlstat
      3 oldolduname
      3 oldstat
      3 olduname
      3 prof
      3 profil
      7 putpmsg
      8 query_module
      3 readdir
      4 select
      1 set_mempolicy
      1 set_thread_area
      3 sigaction
      1 sigaltstack
      1 signal
      2 sigpending
      2 sigprocmask
      3 sigreturn
      3 sigsuspend
      1 spill
      3 stty
      1 swapcontext
      2 switch_endian
      3 sys_debug_setcontext
      5 timerfd
      2 tuxcall
      3 ulimit
      2 umount
      1 uselib
      4 vm86
      2 vm86old
      6 vserver
      1 xtensa

I would guess that there are enough syscall names here that are more likely to
cause problems if the macro is defined then when it is missing, e.g. a common
method in glibc is to check for the older symbol first:

int
__renameat (int oldfd, const char *old, int newfd, const char *new)
{
#ifdef __NR_renameat
  return INLINE_SYSCALL_CALL (renameat, oldfd, old, newfd, new);
#else
  return INLINE_SYSCALL_CALL (renameat2, oldfd, old, newfd, new, 0);
#endif
}

and this breaks if __NR_renameat is sys_ni_syscall. I could not find
any such example that is actually broken with glibc today (presumably
others have checked before me), but other software may do similar
things.

> > For 32-bit oldstat, I'd argue that this should actually get fixed by adding
> > the compat syscall logic. I think this was discussed when Firoz
> > first posted his patches. Something like this:
>
> I'm not clear why we would do that? If there were programs out there
> that wanted oldstat in compat mode surely we would have got a bug report
> by now.
>
> So this just wires up a syscall that no one will ever use?

compat mode is not always reliable, so it's entirely possible that
someone tried it and gave up when it didn't work right away.

My point is that we should always try to make compat mode behave
the exact same way as native mode, if there is a difference between
them, it's a bug of the emulation.

If you are sure that nothing ever enters those system calls, then
we should remove them from native 32-bit mode, otherwise we should
add them in compat mode.

      Arnd
Firoz Khan Jan. 18, 2019, 6:40 a.m. UTC | #4
Hi Arnd,

On Wed, 16 Jan 2019 at 19:23, Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Wed, Jan 16, 2019 at 2:27 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
> > @@ -24,28 +24,28 @@
> >  14     common  mknod                           sys_mknod
> >  15     common  chmod                           sys_chmod
> >  16     common  lchown                          sys_lchown
> > -17     common  break                           sys_ni_syscall
> > -18     32      oldstat                         sys_stat                        sys_ni_syscall
> > -18     64      oldstat                         sys_ni_syscall
> > +17     common  break                           none
> > +18     32      oldstat                         sys_stat                        none
> > +18     64      oldstat                         none
>
> The '64 oldstat' line can simply get dropped here, it has no value
> (I failed to notice this earlier).

The initial requirement is to replace uapi and syscalltbl file with
the script as it is.
If I'm right, for oldstat has uapi header and syscalltbl entry is
sys_ni_syscall. So
the above change will replace uapi and syscalltbl as it is.

We'll do a cleanup for all 10 architectures, so that time we can
remove this (and similer)
entries.

Thanks
Firoz
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl
index c5907a2dbc86..988a7e29245f 100644
--- a/arch/powerpc/kernel/syscalls/syscall.tbl
+++ b/arch/powerpc/kernel/syscalls/syscall.tbl
@@ -24,28 +24,28 @@ 
 14	common	mknod				sys_mknod
 15	common	chmod				sys_chmod
 16	common	lchown				sys_lchown
-17	common	break				sys_ni_syscall
-18	32	oldstat				sys_stat			sys_ni_syscall
-18	64	oldstat				sys_ni_syscall
+17	common	break				none
+18	32	oldstat				sys_stat			none
+18	64	oldstat				none
 19	common	lseek				sys_lseek			compat_sys_lseek
 20	common	getpid				sys_getpid
 21	common	mount				sys_mount			compat_sys_mount
 22	32	umount				sys_oldumount
-22	64	umount				sys_ni_syscall
+22	64	umount				none
 23	common	setuid				sys_setuid
 24	common	getuid				sys_getuid
 25	common	stime				sys_stime			compat_sys_stime
 26	common	ptrace				sys_ptrace			compat_sys_ptrace
 27	common	alarm				sys_alarm
-28	32	oldfstat			sys_fstat			sys_ni_syscall
-28	64	oldfstat			sys_ni_syscall
+28	32	oldfstat			sys_fstat			none
+28	64	oldfstat			none
 29	common	pause				sys_pause
 30	common	utime				sys_utime			compat_sys_utime
-31	common	stty				sys_ni_syscall
-32	common	gtty				sys_ni_syscall
+31	common	stty				none
+32	common	gtty				none
 33	common	access				sys_access
 34	common	nice				sys_nice
-35	common	ftime				sys_ni_syscall
+35	common	ftime				none
 36	common	sync				sys_sync
 37	common	kill				sys_kill
 38	common	rename				sys_rename
@@ -54,7 +54,7 @@ 
 41	common	dup				sys_dup
 42	common	pipe				sys_pipe
 43	common	times				sys_times			compat_sys_times
-44	common	prof				sys_ni_syscall
+44	common	prof				none
 45	common	brk				sys_brk
 46	common	setgid				sys_setgid
 47	common	getgid				sys_getgid
@@ -63,14 +63,14 @@ 
 50	common	getegid				sys_getegid
 51	common	acct				sys_acct
 52	common	umount2				sys_umount
-53	common	lock				sys_ni_syscall
+53	common	lock				none
 54	common	ioctl				sys_ioctl			compat_sys_ioctl
 55	common	fcntl				sys_fcntl			compat_sys_fcntl
-56	common	mpx				sys_ni_syscall
+56	common	mpx				none
 57	common	setpgid				sys_setpgid
-58	common	ulimit				sys_ni_syscall
+58	common	ulimit				none
 59	32	oldolduname			sys_olduname
-59	64	oldolduname			sys_ni_syscall
+59	64	oldolduname			none
 60	common	umask				sys_umask
 61	common	chroot				sys_chroot
 62	common	ustat				sys_ustat			compat_sys_ustat
@@ -79,35 +79,35 @@ 
 65	common	getpgrp				sys_getpgrp
 66	common	setsid				sys_setsid
 67	32	sigaction			sys_sigaction			compat_sys_sigaction
-67	64	sigaction			sys_ni_syscall
+67	64	sigaction			none
 68	common	sgetmask			sys_sgetmask
 69	common	ssetmask			sys_ssetmask
 70	common	setreuid			sys_setreuid
 71	common	setregid			sys_setregid
 72	32	sigsuspend			sys_sigsuspend
-72	64	sigsuspend			sys_ni_syscall
+72	64	sigsuspend			none
 73	32	sigpending			sys_sigpending			compat_sys_sigpending
-73	64	sigpending			sys_ni_syscall
+73	64	sigpending			none
 74	common	sethostname			sys_sethostname
 75	common	setrlimit			sys_setrlimit			compat_sys_setrlimit
 76	32	getrlimit			sys_old_getrlimit		compat_sys_old_getrlimit
-76	64	getrlimit			sys_ni_syscall
+76	64	getrlimit			none
 77	common	getrusage			sys_getrusage			compat_sys_getrusage
 78	common	gettimeofday			sys_gettimeofday		compat_sys_gettimeofday
 79	common	settimeofday			sys_settimeofday		compat_sys_settimeofday
 80	common	getgroups			sys_getgroups
 81	common	setgroups			sys_setgroups
-82	32	select				ppc_select			sys_ni_syscall
-82	64	select				sys_ni_syscall
+82	32	select				ppc_select			none
+82	64	select				none
 83	common	symlink				sys_symlink
-84	32	oldlstat			sys_lstat			sys_ni_syscall
-84	64	oldlstat			sys_ni_syscall
+84	32	oldlstat			sys_lstat			none
+84	64	oldlstat			none
 85	common	readlink			sys_readlink
 86	common	uselib				sys_uselib
 87	common	swapon				sys_swapon
 88	common	reboot				sys_reboot
 89	32	readdir				sys_old_readdir			compat_sys_old_readdir
-89	64	readdir				sys_ni_syscall
+89	64	readdir				none
 90	common	mmap				sys_mmap
 91	common	munmap				sys_munmap
 92	common	truncate			sys_truncate			compat_sys_truncate
@@ -116,10 +116,10 @@ 
 95	common	fchown				sys_fchown
 96	common	getpriority			sys_getpriority
 97	common	setpriority			sys_setpriority
-98	common	profil				sys_ni_syscall
+98	common	profil				none
 99	common	statfs				sys_statfs			compat_sys_statfs
 100	common	fstatfs				sys_fstatfs			compat_sys_fstatfs
-101	common	ioperm				sys_ni_syscall
+101	common	ioperm				none
 102	common	socketcall			sys_socketcall			compat_sys_socketcall
 103	common	syslog				sys_syslog
 104	common	setitimer			sys_setitimer			compat_sys_setitimer
@@ -128,30 +128,30 @@ 
 107	common	lstat				sys_newlstat			compat_sys_newlstat
 108	common	fstat				sys_newfstat			compat_sys_newfstat
 109	32	olduname			sys_uname
-109	64	olduname			sys_ni_syscall
-110	common	iopl				sys_ni_syscall
+109	64	olduname			none
+110	common	iopl				none
 111	common	vhangup				sys_vhangup
-112	common	idle				sys_ni_syscall
-113	common	vm86				sys_ni_syscall
+112	common	idle				none
+113	common	vm86				none
 114	common	wait4				sys_wait4			compat_sys_wait4
 115	common	swapoff				sys_swapoff
 116	common	sysinfo				sys_sysinfo			compat_sys_sysinfo
 117	common	ipc				sys_ipc				compat_sys_ipc
 118	common	fsync				sys_fsync
 119	32	sigreturn			sys_sigreturn			compat_sys_sigreturn
-119	64	sigreturn			sys_ni_syscall
+119	64	sigreturn			none
 120	common	clone				ppc_clone
 121	common	setdomainname			sys_setdomainname
 122	common	uname				sys_newuname
-123	common	modify_ldt			sys_ni_syscall
+123	common	modify_ldt			none
 124	common	adjtimex			sys_adjtimex			compat_sys_adjtimex
 125	common	mprotect			sys_mprotect
 126	32	sigprocmask			sys_sigprocmask			compat_sys_sigprocmask
-126	64	sigprocmask			sys_ni_syscall
-127	common	create_module			sys_ni_syscall
+126	64	sigprocmask			none
+127	common	create_module			none
 128	common	init_module			sys_init_module
 129	common	delete_module			sys_delete_module
-130	common	get_kernel_syms			sys_ni_syscall
+130	common	get_kernel_syms			none
 131	common	quotactl			sys_quotactl
 132	common	getpgid				sys_getpgid
 133	common	fchdir				sys_fchdir
@@ -159,7 +159,7 @@ 
 135	common	sysfs				sys_sysfs
 136	32	personality			sys_personality			ppc64_personality
 136	64	personality			ppc64_personality
-137	common	afs_syscall			sys_ni_syscall
+137	common	afs_syscall			none
 138	common	setfsuid			sys_setfsuid
 139	common	setfsgid			sys_setfsgid
 140	common	_llseek				sys_llseek
@@ -188,9 +188,9 @@ 
 163	common	mremap				sys_mremap
 164	common	setresuid			sys_setresuid
 165	common	getresuid			sys_getresuid
-166	common	query_module			sys_ni_syscall
+166	common	query_module			none
 167	common	poll				sys_poll
-168	common	nfsservctl			sys_ni_syscall
+168	common	nfsservctl			none
 169	common	setresgid			sys_setresgid
 170	common	getresgid			sys_getresgid
 171	common	prctl				sys_prctl
@@ -210,8 +210,8 @@ 
 185	common	sigaltstack			sys_sigaltstack			compat_sys_sigaltstack
 186	32	sendfile			sys_sendfile			compat_sys_sendfile
 186	64	sendfile			sys_sendfile64
-187	common	getpmsg				sys_ni_syscall
-188	common	putpmsg				sys_ni_syscall
+187	common	getpmsg				none
+188	common	putpmsg				none
 189	common	vfork				ppc_vfork
 190	common	ugetrlimit			sys_getrlimit			compat_sys_getrlimit
 191	common	readahead			sys_readahead			compat_sys_readahead
@@ -224,7 +224,7 @@ 
 198	common 	pciconfig_read			sys_pciconfig_read
 199	common 	pciconfig_write			sys_pciconfig_write
 200	common 	pciconfig_iobase		sys_pciconfig_iobase
-201	common	multiplexer			sys_ni_syscall
+201	common	multiplexer			none
 202	common	getdents64			sys_getdents64
 203	common	pivot_root			sys_pivot_root
 204	32	fcntl64				sys_fcntl64			compat_sys_fcntl64
@@ -248,7 +248,7 @@ 
 222	common	sched_setaffinity		sys_sched_setaffinity		compat_sys_sched_setaffinity
 223	common	sched_getaffinity		sys_sched_getaffinity		compat_sys_sched_getaffinity
 # 224 unused
-225	common	tuxcall				sys_ni_syscall
+225	common	tuxcall				none
 226	32	sendfile64			sys_sendfile64			compat_sys_sendfile64
 227	common	io_setup			sys_io_setup			compat_sys_io_setup
 228	common	io_destroy			sys_io_destroy
@@ -279,10 +279,10 @@ 
 252	common	statfs64			sys_statfs64			compat_sys_statfs64
 253	common	fstatfs64			sys_fstatfs64			compat_sys_fstatfs64
 254	32	fadvise64_64			ppc_fadvise64_64
-254	64	fadvise64_64			sys_ni_syscall
+254	64	fadvise64_64			none
 255	common	rtas				sys_rtas
-256	32	sys_debug_setcontext		sys_debug_setcontext		sys_ni_syscall
-256	64	sys_debug_setcontext		sys_ni_syscall
+256	32	sys_debug_setcontext		sys_debug_setcontext		none
+256	64	sys_debug_setcontext		none
 # 257 reserved for vserver
 258	common	migrate_pages			sys_migrate_pages		compat_sys_migrate_pages
 259	common	mbind				sys_mbind			compat_sys_mbind
@@ -390,7 +390,7 @@ 
 360	common	memfd_create			sys_memfd_create
 361	common	bpf				sys_bpf
 362	common	execveat			sys_execveat			compat_sys_execveat
-363	32	switch_endian			sys_ni_syscall
+363	32	switch_endian			none
 363	64	switch_endian			ppc_switch_endian
 364	common	userfaultfd			sys_userfaultfd
 365	common	membarrier			sys_membarrier
diff --git a/arch/powerpc/kernel/syscalls/syscalltbl.sh b/arch/powerpc/kernel/syscalls/syscalltbl.sh
index 0e98a6d64b5f..f9987e265f3f 100644
--- a/arch/powerpc/kernel/syscalls/syscalltbl.sh
+++ b/arch/powerpc/kernel/syscalls/syscalltbl.sh
@@ -12,6 +12,10 @@  emit() {
 	t_nr="$2"
 	t_entry="$3"
 
+	if [ "$t_entry" = "none" ]; then
+		t_entry="sys_ni_syscall"
+	fi
+
 	while [ $t_nxt -lt $t_nr ]; do
 		printf "__SYSCALL(%s,sys_ni_syscall, )\n" "${t_nxt}"
 		t_nxt=$((t_nxt+1))