mbox series

[0/4] kselftest/arm64: Fix compilation warnings/errors in the arm64 tests

Message ID 20241108134920.1233992-1-catalin.marinas@arm.com (mailing list archive)
Headers show
Series kselftest/arm64: Fix compilation warnings/errors in the arm64 tests | expand

Message

Catalin Marinas Nov. 8, 2024, 1:49 p.m. UTC
It looks like people started ignoring the compiler warnings (or even
errors) when building the arm64-specific kselftests. The first three
patches are printf() arguments adjustment. The last one adds
".arch_extension sme", otherwise they fail to build (with my toolchain
versions at least).

Note for future kselftest contributors - try to keep them warning-free.

Catalin Marinas (4):
  kselftest/arm64: Fix printf() compiler warnings in the arm64 fp tests
  kselftest/arm64: Fix printf() warning in the arm64 MTE prctl() test
  kselftest/arm64: Fix printf() compiler warnings in the arm64
    syscall-abi.c tests
  kselftest/arm64: Fix compilation of SME instructions in the arm64 fp
    tests

 tools/testing/selftests/arm64/abi/syscall-abi.c |  8 ++++----
 tools/testing/selftests/arm64/fp/sve-ptrace.c   | 16 +++++++++-------
 tools/testing/selftests/arm64/fp/za-ptrace.c    |  8 +++++---
 tools/testing/selftests/arm64/fp/za-test.S      |  1 +
 tools/testing/selftests/arm64/fp/zt-ptrace.c    |  8 +++++---
 tools/testing/selftests/arm64/fp/zt-test.S      |  1 +
 tools/testing/selftests/arm64/mte/check_prctl.c |  2 +-
 7 files changed, 26 insertions(+), 18 deletions(-)

Comments

Mark Brown Nov. 8, 2024, 2:58 p.m. UTC | #1
On Fri, Nov 08, 2024 at 01:49:16PM +0000, Catalin Marinas wrote:
> It looks like people started ignoring the compiler warnings (or even
> errors) when building the arm64-specific kselftests. The first three
> patches are printf() arguments adjustment. The last one adds
> ".arch_extension sme", otherwise they fail to build (with my toolchain

Unfortunately there's a lot of toolchain variance with these warnings so
a lot of people simply won't see them, you need a fairly fresh toolchain
to see them, and IIRC GCC and clang warn about different sets of things
too which doesn't help.  If you look at the set of tests you're updating
they're all fairly old so will predate the warnings having been added, I
doubt anyone touched them recently enough to see the warnings.
Catalin Marinas Nov. 8, 2024, 3:03 p.m. UTC | #2
On Fri, Nov 08, 2024 at 02:58:34PM +0000, Mark Brown wrote:
> On Fri, Nov 08, 2024 at 01:49:16PM +0000, Catalin Marinas wrote:
> > It looks like people started ignoring the compiler warnings (or even
> > errors) when building the arm64-specific kselftests. The first three
> > patches are printf() arguments adjustment. The last one adds
> > ".arch_extension sme", otherwise they fail to build (with my toolchain
> 
> Unfortunately there's a lot of toolchain variance with these warnings so
> a lot of people simply won't see them, you need a fairly fresh toolchain
> to see them, and IIRC GCC and clang warn about different sets of things
> too which doesn't help.  If you look at the set of tests you're updating
> they're all fairly old so will predate the warnings having been added, I
> doubt anyone touched them recently enough to see the warnings.

But we should still fix them ;). I tried both gcc-12 and clang-14 that
come with my Debian stable installation. If we see others, we'll fix
them in time.

Thanks for the reviews.
Mark Brown Nov. 8, 2024, 3:16 p.m. UTC | #3
On Fri, Nov 08, 2024 at 03:03:43PM +0000, Catalin Marinas wrote:
> On Fri, Nov 08, 2024 at 02:58:34PM +0000, Mark Brown wrote:
> > On Fri, Nov 08, 2024 at 01:49:16PM +0000, Catalin Marinas wrote:

> > > It looks like people started ignoring the compiler warnings (or even
> > > errors) when building the arm64-specific kselftests. The first three
> > > patches are printf() arguments adjustment. The last one adds
> > > ".arch_extension sme", otherwise they fail to build (with my toolchain

> > Unfortunately there's a lot of toolchain variance with these warnings so
> > a lot of people simply won't see them, you need a fairly fresh toolchain

> But we should still fix them ;). I tried both gcc-12 and clang-14 that
> come with my Debian stable installation. If we see others, we'll fix
> them in time.

Oh, we should definitely fix them - it's just I'm not sure people have
been seeing them to be ignoring them as you mentioned above.  AFAICT
nobody goes on warning patrol in the selftests with any degree of
frequency like happens in the main kernel, nor tunes the warning set, so
they tend to build up in the older tests that aren't being updated as a
matter of routine.  You do sometimes get someone coming in and doing a
round of cleanups but it's sporadic.
Catalin Marinas Nov. 12, 2024, 4:07 p.m. UTC | #4
On Fri, 08 Nov 2024 13:49:16 +0000, Catalin Marinas wrote:
> It looks like people started ignoring the compiler warnings (or even
> errors) when building the arm64-specific kselftests. The first three
> patches are printf() arguments adjustment. The last one adds
> ".arch_extension sme", otherwise they fail to build (with my toolchain
> versions at least).
> 
> Note for future kselftest contributors - try to keep them warning-free.
> 
> [...]

Applied to arm64 (for-next/kselftest), thanks!

[1/4] kselftest/arm64: Fix printf() compiler warnings in the arm64 fp tests
      https://git.kernel.org/arm64/c/b6bd50dd3b56
[2/4] kselftest/arm64: Fix printf() warning in the arm64 MTE prctl() test
      https://git.kernel.org/arm64/c/0cc6b94a445c
[3/4] kselftest/arm64: Fix printf() compiler warnings in the arm64 syscall-abi.c tests
      https://git.kernel.org/arm64/c/694e2803fece