linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] KVM: selftests: Binary stats fixes and infra updates
@ 2024-12-20  1:38 Sean Christopherson
  2024-12-20  1:38 ` [PATCH 1/8] KVM: selftests: Fix mostly theoretical leak of VM's binary stats FD Sean Christopherson
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Sean Christopherson @ 2024-12-20  1:38 UTC (permalink / raw)
  To: Marc Zyngier, Oliver Upton, Anup Patel, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Christian Borntraeger, Janosch Frank,
	Claudio Imbrenda, Sean Christopherson, Paolo Bonzini
  Cc: linux-arm-kernel, kvmarm, kvm, kvm-riscv, linux-riscv,
	linux-kernel

Fix a handful of bugs in the binary stats infrastructure, expand support
to vCPU-scoped stats, enumerate all KVM stats in selftests, and use the
enumerated stats to assert at compile-time that {vm,vcpu}_get_stat() is
getting a stat that actually exists.

Most of the bugs are benign, and AFAICT, none actually cause problems in
the current code base.  The worst of the bugs is lack of validation that
the requested stat actually exists, which is quite annoying if someone
fat fingers a stat name, tries to get a vCPU stat on a VM FD, etc.

FWIW, I'm not entirely convinced enumerating all stats is worth doing in
selftests.  It seems nice to have?  But I don't know that it'll be worth
the maintenance cost.  It was easy enough to implement, so here it is...

Sean Christopherson (8):
  KVM: selftests: Fix mostly theoretical leak of VM's binary stats FD
  KVM: selftests: Close VM's binary stats FD when releasing VM
  KVM: selftests: Assert that __vm_get_stat() actually finds a stat
  KVM: selftests: Macrofy vm_get_stat() to auto-generate stat name
    string
  KVM: selftests: Add struct and helpers to wrap binary stats cache
  KVM: selftests: Get VM's binary stats FD when opening VM
  KVM: selftests: Add infrastructure for getting vCPU binary stats
  KVM: selftests: Add compile-time assertions to guard against stats
    typos

Sean Christopherson (8):
  KVM: selftests: Fix mostly theoretical leak of VM's binary stats FD
  KVM: selftests: Close VM's binary stats FD when releasing VM
  KVM: selftests: Assert that __vm_get_stat() actually finds a stat
  KVM: selftests: Macrofy vm_get_stat() to auto-generate stat name
    string
  KVM: selftests: Add struct and helpers to wrap binary stats cache
  KVM: selftests: Get VM's binary stats FD when opening VM
  KVM: selftests: Add infrastructure for getting vCPU binary stats
  KVM: selftests: Add compile-time assertions to guard against stats
    typos

 .../kvm/include/arm64/kvm_util_arch.h         |  12 ++
 .../testing/selftests/kvm/include/kvm_util.h  |  49 ++++++--
 .../selftests/kvm/include/kvm_util_types.h    |   6 +
 .../kvm/include/riscv/kvm_util_arch.h         |  14 +++
 .../kvm/include/s390/kvm_util_arch.h          | 113 ++++++++++++++++++
 .../selftests/kvm/include/x86/kvm_util_arch.h |  52 ++++++++
 tools/testing/selftests/kvm/lib/kvm_util.c    |  79 ++++++------
 .../kvm/x86/dirty_log_page_splitting_test.c   |   6 +-
 .../selftests/kvm/x86/nx_huge_pages_test.c    |   4 +-
 .../selftests/kvm/x86/xapic_ipi_test.c        |   2 +
 10 files changed, 286 insertions(+), 51 deletions(-)


base-commit: dcab55cef6f247a71a75a239d4063018dc83a671
-- 
2.47.1.613.gc27f4b7a9f-goog



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

end of thread, other threads:[~2025-01-10  1:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-20  1:38 [PATCH 0/8] KVM: selftests: Binary stats fixes and infra updates Sean Christopherson
2024-12-20  1:38 ` [PATCH 1/8] KVM: selftests: Fix mostly theoretical leak of VM's binary stats FD Sean Christopherson
2024-12-20  1:39 ` [PATCH 2/8] KVM: selftests: Close VM's binary stats FD when releasing VM Sean Christopherson
2024-12-20  1:39 ` [PATCH 3/8] KVM: selftests: Assert that __vm_get_stat() actually finds a stat Sean Christopherson
2024-12-20  1:39 ` [PATCH 4/8] KVM: selftests: Macrofy vm_get_stat() to auto-generate stat name string Sean Christopherson
2024-12-20  1:39 ` [PATCH 5/8] KVM: selftests: Add struct and helpers to wrap binary stats cache Sean Christopherson
2024-12-20  1:39 ` [PATCH 6/8] KVM: selftests: Get VM's binary stats FD when opening VM Sean Christopherson
2024-12-20  1:39 ` [PATCH 7/8] KVM: selftests: Add infrastructure for getting vCPU binary stats Sean Christopherson
2024-12-20  1:39 ` [PATCH 8/8] KVM: selftests: Add compile-time assertions to guard against stats typos Sean Christopherson
2025-01-09 19:47 ` [PATCH 0/8] KVM: selftests: Binary stats fixes and infra updates Sean Christopherson
2025-01-10  1:15   ` 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).