Re: [PATCH 06/10] tools/include: Sync uapi/asm-generic/unistd.h with the kernel sources

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Wed, Aug 07, 2024 at 09:11:01AM +0200, Arnd Bergmann wrote:
> On Wed, Aug 7, 2024, at 00:50, Namhyung Kim wrote:
> > And arch syscall tables to pick up changes from:
> >
> >   b1e31c134a8a powerpc: restore some missing spu syscalls
> >   d3882564a77c syscalls: fix compat_sys_io_pgetevents_time64 usage
> >   54233a425403 uretprobe: change syscall number, again
> >   63ded110979b uprobe: Change uretprobe syscall scope and number
> >   9142be9e6443 x86/syscall: Mark exit[_group] syscall handlers __noreturn
> >   9aae1baa1c5d x86, arm: Add missing license tag to syscall tables files
> >   5c28424e9a34 syscalls: Fix to add sys_uretprobe to syscall.tbl
> >   190fec72df4a uprobe: Wire up uretprobe system call
> >
> > This should be used to beautify syscall arguments and it addresses
> > these tools/perf build warnings:
> >
> >   Warning: Kernel ABI header differences:
> >   diff -u tools/arch/arm64/include/uapi/asm/unistd.h 
> > arch/arm64/include/uapi/asm/unistd.h
> >   diff -u tools/include/uapi/asm-generic/unistd.h 
> > include/uapi/asm-generic/unistd.h
> >   diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl 
> > arch/x86/entry/syscalls/syscall_64.tbl
> >   diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl 
> > arch/powerpc/kernel/syscalls/syscall.tbl
> >   diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl 
> > arch/s390/kernel/syscalls/syscall.tbl
> >
> > Please see tools/include/uapi/README for details (it's in the first patch
> > of this series).
> >
> > Cc: Arnd Bergmann <arnd@xxxxxxxx>
> > Cc: linux-arch@xxxxxxxxxxxxxxx
> > Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> > ---
> >  tools/arch/arm64/include/uapi/asm/unistd.h    | 24 +------------------
> >  tools/include/uapi/asm-generic/unistd.h       |  2 +-
> >  .../arch/powerpc/entry/syscalls/syscall.tbl   |  6 ++++-
> >  .../perf/arch/s390/entry/syscalls/syscall.tbl |  2 +-
> >  .../arch/x86/entry/syscalls/syscall_64.tbl    |  8 ++++---
> >  5 files changed, 13 insertions(+), 29 deletions(-)
> >
> > diff --git a/tools/arch/arm64/include/uapi/asm/unistd.h 
> > b/tools/arch/arm64/include/uapi/asm/unistd.h
> > index 9306726337fe..df36f23876e8 100644
> > --- a/tools/arch/arm64/include/uapi/asm/unistd.h
> > +++ b/tools/arch/arm64/include/uapi/asm/unistd.h
> > -
> > -#define __ARCH_WANT_RENAMEAT
> > -#define __ARCH_WANT_NEW_STAT
> > -#define __ARCH_WANT_SET_GET_RLIMIT
> > -#define __ARCH_WANT_TIME32_SYSCALLS
> > -#define __ARCH_WANT_MEMFD_SECRET
> > -
> > -#include <asm-generic/unistd.h>
> > +#include <asm/unistd_64.h>
> 
> This part won't work by itself, since you don't pick up
> the generated asm/unistd_64.h header but keep the old
> asm-generic/unistd.h header. Both have the same contents,
> so the easy way to do this is to just keep the existing
> version of the arm64 header for 6.11 and add a script to
> generate it in 6.12 the way we do for x86, using an
> architecture-independent script.

Thanks for the review, I'll drop the arm64 parts for now.

> 
> > @@ -68,7 +69,7 @@
> >  57	common	fork			sys_fork
> >  58	common	vfork			sys_vfork
> >  59	64	execve			sys_execve
> > -60	common	exit			sys_exit
> > +60	common	exit			sys_exit			-			noreturn
> >  61	common	wait4			sys_wait4
> >  62	common	kill			sys_kill
> >  63	common	uname			sys_newuname
> 
> Have you checked if this works correctly with the
> existing tools/perf/arch/x86/entry/syscalls/syscalltbl.sh?

Yep, the script only cares about the number and the name.

  # the params are: nr abi name entry compat
  # use _ for intentionally unused variables according to SC2034
  while read nr _ name _ _; do
      if [ $nr -ge 512 ] ; then # discard compat sycalls
          break
      fi
  
      emit "$nr" "$name"
      max_nr=$nr
  done < $sorted_table

The only difference I see was the added uretprobe syscall.

  $ tools/arch/x86/entry/syscalls/syscalltbl.sh tools/arch/x86/entry/syscalls/syscall_64.tbl x86_64 > b
  (apply this series...)
  $ tools/arch/x86/entry/syscalls/syscalltbl.sh tools/arch/x86/entry/syscalls/syscall_64.tbl x86_64 > a
  
  $ diff -u b a
  --- b	2024-08-07 10:28:04.267738574 -0700
  +++ a	2024-08-07 10:28:18.543965369 -0700
  @@ -334,6 +334,7 @@
   	[332] = "statx",
   	[333] = "io_pgetevents",
   	[334] = "rseq",
  +	[335] = "uretprobe",
   	[424] = "pidfd_send_signal",
   	[425] = "io_uring_setup",
   	[426] = "io_uring_enter",

Thanks,
Namhyung

> 
> Since not just table file contents but also the file format
> changed here, there is a good chance that the output
> is no longer what we need.
> 
> Unfortunately, the format on x86 is now incompatible with
> the one on s390. I have a patch to change s390 in the future
> so we can use a single script for all of them.
> 
>       Arnd




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux