Commit da42b522 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

tools headers: Update the syscall tables and unistd.h, mostly to support the new 'mseal' syscall

But also to wire up shadow stacks on 32-bit x86, picking up those
changes from these csets:

  ff388fe5 ("mseal: wire up mseal syscall")
  2883f01e ("x86/shstk: Enable shadow stacks for x32")

This makes 'perf trace' support it, now its possible, for instance to
do:

  # perf trace -e mseal --max-stack=16

Here is an example with the 'sendmmsg' syscall:

  root@x1:~# perf trace -e sendmmsg --max-stack 16 --max-events=1
       0.000 ( 0.062 ms): dbus-broker/1012 sendmmsg(fd: 150, mmsg: 0x7ffef57cca50, vlen: 1, flags: DONTWAIT|NOSIGNAL) = 1
                                         syscall_exit_to_user_mode_prepare ([kernel.kallsyms])
                                         syscall_exit_to_user_mode_prepare ([kernel.kallsyms])
                                         syscall_exit_to_user_mode ([kernel.kallsyms])
                                         do_syscall_64 ([kernel.kallsyms])
                                         entry_SYSCALL_64 ([kernel.kallsyms])
                                         [0x117ce7] (/usr/lib64/libc.so.6 (deleted))
  root@x1:~#

To do a system wide tracing of the new 'mseal' syscall with a backtrace
of at most 16 entries.

This addresses these perf tools build warnings:

  Warning: Kernel ABI header differences:
    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
    diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: H J Lu <hjl.tools@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jeff Xu <jeffxu@chromium.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/ZlXlo4TNcba4wnVZ@x1


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 001821b0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -842,8 +842,11 @@ __SYSCALL(__NR_lsm_set_self_attr, sys_lsm_set_self_attr)
#define __NR_lsm_list_modules 461
__SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules)

#define __NR_mseal 462
__SYSCALL(__NR_mseal, sys_mseal)

#undef __NR_syscalls
#define __NR_syscalls 462
#define __NR_syscalls 463

/*
 * 32 bit systems traditionally used different
+1 −0
Original line number Diff line number Diff line
@@ -376,3 +376,4 @@
459	n64	lsm_get_self_attr		sys_lsm_get_self_attr
460	n64	lsm_set_self_attr		sys_lsm_set_self_attr
461	n64	lsm_list_modules		sys_lsm_list_modules
462	n64	mseal				sys_mseal
+1 −0
Original line number Diff line number Diff line
@@ -548,3 +548,4 @@
459	common	lsm_get_self_attr		sys_lsm_get_self_attr
460	common	lsm_set_self_attr		sys_lsm_set_self_attr
461	common	lsm_list_modules		sys_lsm_list_modules
462	common	mseal				sys_mseal
+1 −0
Original line number Diff line number Diff line
@@ -464,3 +464,4 @@
459  common	lsm_get_self_attr	sys_lsm_get_self_attr		sys_lsm_get_self_attr
460  common	lsm_set_self_attr	sys_lsm_set_self_attr		sys_lsm_set_self_attr
461  common	lsm_list_modules	sys_lsm_list_modules		sys_lsm_list_modules
462  common	mseal			sys_mseal			sys_mseal
+2 −1
Original line number Diff line number Diff line
@@ -374,7 +374,7 @@
450	common	set_mempolicy_home_node	sys_set_mempolicy_home_node
451	common	cachestat		sys_cachestat
452	common	fchmodat2		sys_fchmodat2
453	64	map_shadow_stack	sys_map_shadow_stack
453	common	map_shadow_stack	sys_map_shadow_stack
454	common	futex_wake		sys_futex_wake
455	common	futex_wait		sys_futex_wait
456	common	futex_requeue		sys_futex_requeue
@@ -383,6 +383,7 @@
459	common	lsm_get_self_attr	sys_lsm_get_self_attr
460	common	lsm_set_self_attr	sys_lsm_set_self_attr
461	common	lsm_list_modules	sys_lsm_list_modules
462 	common  mseal			sys_mseal

#
# Due to a historical design error, certain syscalls are numbered differently