linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] PMU partitioning driver support
@ 2025-01-27 22:20 Colton Lewis
  2025-01-27 22:20 ` [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU Colton Lewis
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Colton Lewis @ 2025-01-27 22:20 UTC (permalink / raw)
  To: kvm
  Cc: Russell King, Catalin Marinas, Will Deacon, Marc Zyngier,
	Oliver Upton, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
	Mark Rutland, Paolo Bonzini, Shuah Khan, linux-arm-kernel,
	linux-kernel, kvmarm, linux-kselftest, Colton Lewis

This series introduces support in the ARM PMUv3 driver for
partitioning PMU counters into two separate ranges by taking advantage
of the MDCR_EL2.HPMN register field.

The advantage of a partitioned PMU would be to allow KVM guests direct
access to a subset of PMU functionality, greatly reducing the overhead
of performance monitoring in guests.

While this series could be accepted on its own merits, practically
there is a lot more to be done before it will be fully useful, so I'm
sending as an RFC for now.

This patch is based on v6.13-rc7. It needs a small additional change
after Oliver's Debug cleanups series going into 6.14, specifically
this patch [1], because it changes kvm_arm_setup_mdcr_el2() to
initialize HPMN from a cached value read early in the boot process
instead of reading from the register. The only sensible way I can see
to deal with this is returning to reading the register.

[1] https://lore.kernel.org/kvmarm/20241219224116.3941496-3-oliver.upton@linux.dev/

Colton Lewis (4):
  perf: arm_pmuv3: Introduce module param to partition the PMU
  KVM: arm64: Make guests see only counters they can access
  perf: arm_pmuv3: Generalize counter bitmasks
  perf: arm_pmuv3: Keep out of guest counter partition

 arch/arm/include/asm/arm_pmuv3.h              |  10 ++
 arch/arm64/include/asm/arm_pmuv3.h            |  10 ++
 arch/arm64/kvm/pmu-emul.c                     |   8 +-
 drivers/perf/arm_pmuv3.c                      | 113 ++++++++++++++++--
 include/linux/perf/arm_pmu.h                  |   2 +
 include/linux/perf/arm_pmuv3.h                |  34 +++++-
 .../kvm/aarch64/vpmu_counter_access.c         |   2 +-
 7 files changed, 160 insertions(+), 19 deletions(-)


base-commit: 5bc55a333a2f7316b58edc7573e8e893f7acb532
--
2.48.1.262.g85cc9f2d1e-goog


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

end of thread, other threads:[~2025-02-03 21:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-27 22:20 [RFC PATCH 0/4] PMU partitioning driver support Colton Lewis
2025-01-27 22:20 ` [RFC PATCH 1/4] perf: arm_pmuv3: Introduce module param to partition the PMU Colton Lewis
2025-01-28  9:27   ` Marc Zyngier
2025-01-28 22:08     ` Colton Lewis
2025-01-28 23:08       ` Colton Lewis
2025-01-29 15:33       ` Marc Zyngier
2025-01-29 21:27         ` Colton Lewis
2025-02-03 21:37           ` Colton Lewis
2025-01-28 15:25   ` Rob Herring
2025-01-28 22:27     ` Colton Lewis
2025-01-27 22:20 ` [RFC PATCH 2/4] KVM: arm64: Make guests see only counters they can access Colton Lewis
2025-01-27 22:20 ` [RFC PATCH 3/4] perf: arm_pmuv3: Generalize counter bitmasks Colton Lewis
2025-01-27 22:20 ` [RFC PATCH 4/4] perf: arm_pmuv3: Keep out of guest counter partition Colton Lewis
2025-01-28 15:55   ` Suzuki K Poulose
2025-01-28 22:30     ` Colton Lewis

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