linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] KVM: Refactor KVM stats macros and enable custom stat names
@ 2023-03-06 19:01 David Matlack
  2023-03-06 19:01 ` [PATCH v2 1/4] KVM: Refactor stats descriptor generation macros David Matlack
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: David Matlack @ 2023-03-06 19:01 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: kvm, David Hildenbrand, Anup Patel, Paul Walmsley, kvmarm,
	linux-riscv, Claudio Imbrenda, Janosch Frank, Marc Zyngier,
	Huacai Chen, Aleksandar Markovic, Zenghui Yu, Palmer Dabbelt,
	Christian Borntraeger, Eric Farman, Albert Ou, Suzuki K Poulose,
	Nicholas Piggin, Sathvika Vasireddy, Atish Patra, David Matlack,
	linux-arm-kernel, Philippe Mathieu-Daudé,
	Sean Christopherson, linux-mips, Oliver Upton, J ames Morse,
	kvm-riscv, linuxppc-dev

This series refactors the KVM stats macros to reduce duplication and
adds the support for choosing custom names for stats.

Custom name makes it possible to decouple the userspace-visible stat
names from their internal representation in C. This can allow future
commits to refactor the various stats structs without impacting
userspace tools that read KVM stats.

This also allows stats to be stored in data structures such as arrays,
without needing unions to access specific stats. Case in point, the last
patch in this series removes the pages_{4k,2m,1g} union, which is a
useful cleanup to prepare for sharing paging code across architectures
[1].

And for full transparency, another motivation for this series it that at
Google we have several out-of-tree stats that use arrays. Custom name
support is something we added internally and it reduces our technical
debt to get the support merged upstream.

Tested on x86. Compile tested on ARM. Not yet tested on any other
architectures.

Link: https://lore.kernel.org/kvm/20221208193857.4090582-1-dmatlack@google.com/

v2:
 - Refactor stat macros (patch 1) to reduce duplication and make it
   simpler to add custom name support [Sean]

v1: https://lore.kernel.org/kvm/20230118175300.790835-1-dmatlack@google.com/

David Matlack (4):
  KVM: Refactor stats descriptor generation macros
  KVM: Refactor designated initializer macros for struct _kvm_stats_desc
  KVM: Allow custom names for KVM_STAT()
  KVM: x86: Drop union for pages_{4k,2m,1g} stats

 arch/arm64/kvm/guest.c          |  14 +--
 arch/mips/kvm/mips.c            |  54 ++++-----
 arch/powerpc/kvm/book3s.c       |  62 +++++-----
 arch/powerpc/kvm/booke.c        |  48 ++++----
 arch/riscv/kvm/vcpu.c           |  16 +--
 arch/s390/kvm/kvm-s390.c        | 198 ++++++++++++++++----------------
 arch/x86/include/asm/kvm_host.h |   9 +-
 arch/x86/kvm/x86.c              |  94 +++++++--------
 include/linux/kvm_host.h        | 179 +++++++++++------------------
 9 files changed, 314 insertions(+), 360 deletions(-)


base-commit: 45dd9bc75d9adc9483f0c7d662ba6e73ed698a0b
-- 
2.40.0.rc0.216.gc4246ad0f0-goog


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

end of thread, other threads:[~2023-05-09 20:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-06 19:01 [PATCH v2 0/4] KVM: Refactor KVM stats macros and enable custom stat names David Matlack
2023-03-06 19:01 ` [PATCH v2 1/4] KVM: Refactor stats descriptor generation macros David Matlack
2023-04-06  4:42   ` Anup Patel
2023-03-06 19:01 ` [PATCH v2 2/4] KVM: Refactor designated initializer macros for struct _kvm_stats_desc David Matlack
2023-03-06 19:01 ` [PATCH v2 3/4] KVM: Allow custom names for KVM_STAT() David Matlack
2023-03-06 19:01 ` [PATCH v2 4/4] KVM: x86: Drop union for pages_{4k,2m,1g} stats David Matlack
2023-04-07 23:30 ` [PATCH v2 0/4] KVM: Refactor KVM stats macros and enable custom stat names Sean Christopherson
2023-04-26 17:21 ` Oliver Upton
2023-05-09 20:51 ` David Matlack

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).