linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/14] KVM: selftests: Clang fixes, Makefile cleanup
@ 2022-12-13  0:16 Sean Christopherson
  2022-12-13  0:16 ` [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long Sean Christopherson
                   ` (13 more replies)
  0 siblings, 14 replies; 29+ messages in thread
From: Sean Christopherson @ 2022-12-13  0:16 UTC (permalink / raw)
  To: Paolo Bonzini, Marc Zyngier, Paul Walmsley, Palmer Dabbelt,
	Albert Ou, Nathan Chancellor, Nick Desaulniers
  Cc: James Morse, Alexandru Elisei, Suzuki K Poulose, Oliver Upton,
	Tom Rix, kvm, linux-arm-kernel, kvmarm, kvmarm, linux-riscv, llvm,
	linux-kernel, Ricardo Koller, Sean Christopherson, Aaron Lewis,
	Raghavendra Rao Ananta

Fix a variety of KVM selftests issues exposed by clang, and rework the
Makefile and .gitignore to reduce the maintenance burden of selftests.

For the Makefile, programmatically generate the list of targets by
looking for .c files, and opt-out via a dummy macro in the source
instead of forcing architectures to opt-in.  The opt-out approach is
less error prone (harder to forget to add an arch), doesn't generate
unnecessary conflicts if multiple tests are added simultanesouly, and
makes it much easier to understand which tests aren't supported, e.g.

  $ git grep TEST_UNSUPPORTED | grep aarch64
  hardware_disable_test.c:TEST_UNSUPPORTED(aarch64);
  max_guest_memory_test.c:TEST_UNSUPPORTED(aarch64);
  system_counter_offset_test.c:TEST_UNSUPPORTED(aarch64);

This all started when trying to reproduce clang build errors reported by
Raghu and Aaron that were introduced by commit 6b6f71484bf4 ("KVM:
selftests: Implement memcmp(), memcpy(), and memset() for guest use").
Just getting selftests to compile with clang was a nightmare, as it took
me several hours to realize that "CC=clang make" and "make CC=clang"
aren't equivalent, and that the "include ../lib.mak" buried halfway through
the Makefile was overriding "CC=clang make".

After too many hours fighting to get clang working, my frustration with
the Makefile boiled over a bit...

Note, I have fixes for the RISC-V RSEQ bugs (outside of selftests/kvm) that
I'll post separately.

Tested on x86 and arm, build tested on s390x and RISC-V, all with both gcc
and clang.

Sean Christopherson (14):
  KVM: selftests: Define literal to asm constraint in aarch64 as
    unsigned long
  KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c
  KVM: selftests: Fix divide-by-zero bug in memslot_perf_test
  KVM: selftests: Use pattern matching in .gitignore
  KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width()
  KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86
  KVM: selftests: Use proper function prototypes in probing code
  KVM: selftests: Probe -no-pie with actual CFLAGS used to compile
  KVM: selftests: Explicitly disable builtins for mem*() overrides
  KVM: selftests: Include lib.mk before consuming $(CC)
  KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
  KVM: selftests: Use wildcards to find library source files
  KVM: selftests: Use wildcards to find targets and test source files
  KVM: selftests: Enable RSEQ test for RISC-V

 tools/testing/selftests/kvm/.gitignore        |  91 +------
 tools/testing/selftests/kvm/Makefile          | 229 +++---------------
 .../selftests/kvm/aarch64/page_fault_test.c   |   2 +-
 .../selftests/kvm/access_tracking_perf_test.c |   3 +
 .../selftests/kvm/dirty_log_perf_test.c       |   3 +
 .../selftests/kvm/hardware_disable_test.c     |   4 +
 .../testing/selftests/kvm/include/test_util.h |  11 +
 .../selftests/kvm/lib/x86_64/processor.c      |   2 +-
 .../selftests/kvm/max_guest_memory_test.c     |   4 +
 .../kvm/memslot_modification_stress_test.c    |   3 +
 .../testing/selftests/kvm/memslot_perf_test.c |   6 +
 tools/testing/selftests/kvm/steal_time.c      |   3 +
 .../kvm/system_counter_offset_test.c          |   4 +
 .../kvm/x86_64/vmx_tsc_adjust_test.c          |   5 -
 14 files changed, 80 insertions(+), 290 deletions(-)


base-commit: f1a1d3aff0cc2e68a9ebbd8810d7dcd8cfe2714b
-- 
2.39.0.rc1.256.g54fd8350bd-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2023-01-11 16:24 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-13  0:16 [PATCH 00/14] KVM: selftests: Clang fixes, Makefile cleanup Sean Christopherson
2022-12-13  0:16 ` [PATCH 01/14] KVM: selftests: Define literal to asm constraint in aarch64 as unsigned long Sean Christopherson
2022-12-13  9:51   ` Philippe Mathieu-Daudé
2022-12-13  0:16 ` [PATCH 02/14] KVM: selftests: Delete dead code in x86_64/vmx_tsc_adjust_test.c Sean Christopherson
2022-12-13  0:16 ` [PATCH 03/14] KVM: selftests: Fix divide-by-zero bug in memslot_perf_test Sean Christopherson
2022-12-13  9:46   ` Philippe Mathieu-Daudé
2022-12-13  0:16 ` [PATCH 04/14] KVM: selftests: Use pattern matching in .gitignore Sean Christopherson
2022-12-13  0:16 ` [PATCH 05/14] KVM: selftests: Fix a typo in x86-64's kvm_get_cpu_address_width() Sean Christopherson
2022-12-13  9:47   ` Philippe Mathieu-Daudé
2022-12-13  0:16 ` [PATCH 06/14] KVM: selftests: Rename UNAME_M to ARCH_DIR, fill explicitly for x86 Sean Christopherson
2022-12-13 20:03   ` Sean Christopherson
2022-12-14  9:43     ` Marc Zyngier
2022-12-24  9:12   ` Paolo Bonzini
2022-12-13  0:16 ` [PATCH 07/14] KVM: selftests: Use proper function prototypes in probing code Sean Christopherson
2022-12-13  9:48   ` Philippe Mathieu-Daudé
2022-12-13  0:16 ` [PATCH 08/14] KVM: selftests: Probe -no-pie with actual CFLAGS used to compile Sean Christopherson
2022-12-13  0:16 ` [PATCH 09/14] KVM: selftests: Explicitly disable builtins for mem*() overrides Sean Christopherson
2022-12-24  9:16   ` Paolo Bonzini
2022-12-13  0:16 ` [PATCH 10/14] KVM: selftests: Include lib.mk before consuming $(CC) Sean Christopherson
2022-12-24  9:18   ` Paolo Bonzini
2022-12-13  0:16 ` [PATCH 11/14] KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning Sean Christopherson
2022-12-13  1:36   ` Nick Desaulniers
2022-12-13  2:13     ` Sean Christopherson
2023-01-11 16:23       ` Paolo Bonzini
2022-12-13  0:16 ` [PATCH 12/14] KVM: selftests: Use wildcards to find library source files Sean Christopherson
2022-12-24  9:23   ` Paolo Bonzini
2023-01-04  1:09     ` Sean Christopherson
2022-12-13  0:16 ` [PATCH 13/14] KVM: selftests: Use wildcards to find targets and test " Sean Christopherson
2022-12-13  0:16 ` [PATCH 14/14] KVM: selftests: Enable RSEQ test for RISC-V Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).