lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 28 Dec 2020 03:39:41 +0100
From:   Hans-Peter Nilsson <>
To:     <>,
CC:     John Garry <>, Will Deacon <>,
        Mathieu Poirier <>,
        Leo Yan <>,
        Peter Zijlstra <>,
        Ingo Molnar <>,
        Arnaldo Carvalho de Melo <>,
        Mark Rutland <>,
        Alexander Shishkin <>,
        Jiri Olsa <>,
        Namhyung Kim <>,
        Kim Phillips <>
Subject: [PATCH] perf arm64: Fix mksyscalltbl, don't lose syscalls due to sort -nu

When using "sort -nu", arm64 syscalls were lost.  That is, the
io_setup syscall (number 0) and all but one (typically
ftruncate; 64) of the syscalls that are defined symbolically
(like "#define __NR_ftruncate __NR3264_ftruncate") at the point
where "sort" is applied.

This creation-of-syscalls.c-scheme is, judging from comments,
copy-pasted from powerpc, and worked there because at the time,
its tools/arch/powerpc/include/uapi/asm/unistd.h had *literals*,
like "#define __NR_ftruncate 93".

With sort being numeric and the non-numeric key effectively
evaluating to 0, the sort option "-u" means these "duplicates"
are removed.  There's no need to remove syscall lines with
duplicate numbers for arm64 because there are none, so let's fix
that by just losing the "-u".  Having the table numerically
sorted on syscall-number for the rest of the syscalls looks
nice, so keep the "-n".

Signed-off-by: Hans-Peter Nilsson <>
Cc: John Garry <>
Cc: Will Deacon <>
Cc: Mathieu Poirier <>
Cc: Leo Yan <>
Cc: Peter Zijlstra <>
Cc: Ingo Molnar <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Mark Rutland <>
Cc: Alexander Shishkin <>
Cc: Jiri Olsa <>
Cc: Namhyung Kim <>
Cc: Kim Phillips <>
 tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
index 459469b7222c..a7ca48d1e37b 100755
--- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
+++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
@@ -58,5 +58,5 @@ create_table()
 $gcc -E -dM -x c -I $incpath/include/uapi $input \
 	|sed -ne 's/^#define __NR_//p' \
-	|sort -t' ' -k2 -nu	       \
+	|sort -t' ' -k2 -n	       \

brgds, H-P

Powered by blists - more mailing lists