lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251205162147.GR724103@e132581.arm.com>
Date: Fri, 5 Dec 2025 16:21:47 +0000
From: Leo Yan <leo.yan@....com>
To: Ian Rogers <irogers@...gle.com>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
	Namhyung Kim <namhyung@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
	Adrian Hunter <adrian.hunter@...el.com>,
	James Clark <james.clark@...aro.org>, linux-kernel@...r.kernel.org,
	linux-perf-users@...r.kernel.org
Subject: Re: [PATCH 2/2] Revert "perf tools: Fix arm64 build by generating
 unistd_64.h"

On Thu, Dec 04, 2025 at 10:19:59AM -0800, Ian Rogers wrote:
> On Thu, Dec 4, 2025 at 8:53 AM Leo Yan <leo.yan@....com> wrote:
> >
> > This reverts:
> >
> > commit 8988c4b91945 ("perf tools: Fix in-source libperf build")
> > commit bfb713ea53c7 ("perf tools: Fix arm64 build by generating unistd_64.h")
> >
> > Since we now have a static unistd_64.h for the arm64 build, there is no
> > need to generate unistd_64.h in libperf.  Revert all patches related to
> > generating unistd_64.h.
> 
> Could we generate the file and then compare the two? We do something
> like this for empty-pmu-events.c here:
> https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/tree/tools/perf/pmu-events/Build?h=perf-tools-next#n49
> 
> Similarly, could we get rid of the unistd_64.h generation and just add
> a build time validation test? Generating the file is painful in many
> ways, as this series testifies.

Thanks for suggestions!

I had a question: why we need to maintain unistd.h particually in
./tools folder?  This header is a standard C header and should be
provided by toolchain instead.  Due to multiple copies, it is a bit mess
the programs might include unpurposed one.

I went through the history and found:

  commit 34b009cfde2b ("tools include: Grab copies of arm64 dependent unistd.h files")

It introduces the header unistd.h for generating system call table.

Afterwards,

  commit cb8197db8c09 ("perf tools arm64: Use syscall table")

unistd.h headers are not used to generate syscall table anymore.  Since
then, syscall tables are maintained in
tools/perf/arch/*/entry/syscalls/syscall*.tbl for each arch.

To verify this, I did a quick try with removing x86 and arm64 headers:

  tools/arch/arm64/include/uapi/asm/unistd.h
  tools/arch/x86/include/uapi/asm/unistd.h
  tools/arch/x86/include/uapi/asm/unistd_32.h
  tools/arch/x86/include/uapi/asm/unistd_64.h

I run the linux-tools-container-builds and confirmed all x86 and arm64
building tests pass and did not see any failure.

For a neat fix, I think we can remove all unistd.h headers:

  $ ls tools/arch/*/include/uapi/asm/unistd*
  tools/arch/arc/include/uapi/asm/unistd.h
  tools/arch/hexagon/include/uapi/asm/unistd.h
  tools/arch/riscv/include/uapi/asm/unistd.h
  tools/arch/x86/include/uapi/asm/unistd_64.h
  tools/arch/arm64/include/uapi/asm/unistd.h
  tools/arch/loongarch/include/uapi/asm/unistd.h
  tools/arch/x86/include/uapi/asm/unistd_32.h
  tools/arch/x86/include/uapi/asm/unistd.h

Any concern?  I would get maintainers's confirmation before proceeding.

Thanks,
Leo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ