Linux KVM/arm64 development list
 help / color / mirror / Atom feed
* [PATCH v2 00/12] KVM: arm64: nv: More complete support for FEAT_PMUv3
@ 2024-08-27  0:22 Oliver Upton
  2024-08-27  0:22 ` [PATCH v2 01/12] KVM: arm64: Rename kvm_pmu_valid_counter_mask() Oliver Upton
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Oliver Upton @ 2024-08-27  0:22 UTC (permalink / raw)
  To: kvmarm
  Cc: Marc Zyngier, James Morse, Suzuki K Poulose, Zenghui Yu,
	Ganapatrao Kulkarni, Oliver Upton

Well, looks like that grew a bit :)

The coarse-grained traps for the PMU available at EL2 are annoyingly
effective in both guest and host contexts, meaning the traps need to be
evaluated for a VM's host EL0. Yuck.

First couple patches align the PMU emulation w/ the architecture, where
a PMU has an implemented set of counters *and* a dynamic view of said
counters based on the current context.

Patches 2-9 add support for Host EL0 traps to the NV trap
infrastructure, and takes advantage of it for MDCR_EL2.{TPM, TPMCR,
HPMN}.

The whole interaction of CGTs declaring their EL0-ness is a bit shaky,
since it is a property of the triaged sysreg itself. I structured it
this way for the mostly theoretical problem of a sysreg having multiple
traps, only some of which take effect in Host EL0.

Last bit is the event filter fixes I had from before.

v1: https://lore.kernel.org/kvmarm/20240824001402.3909504-1-oliver.upton@linux.dev/

Oliver Upton (12):
  KVM: arm64: Rename kvm_pmu_valid_counter_mask()
  KVM: arm64: nv: Adjust range of accessible PMCs according to HPMN
  KVM: arm64: nv: Rename BEHAVE_FORWARD_ANY
  KVM: arm64: nv: Add support for describing traps that affect Host EL0
  KVM: arm64: nv: Reinject traps that take effect in Host EL0
  KVM: arm64: nv: Honor MDCR_EL2.{TPM, TPMCR} in Host EL0
  KVM: arm64: nv: Allow coarse-grained trap combos to use complex traps
  KVM: arm64: nv: Describe trap behaviour of MDCR_EL2.HPMN
  KVM: arm64: nv: Advertise support for FEAT_HPMN0
  KVM: arm64: Add helpers to determine if PMC counts at a given EL
  KVM: arm64: nv: Honor NSH filter when in hyp context
  KVM: arm64: nv: Reprogram PMU events affected by nested transition

 arch/arm64/include/asm/kvm_emulate.h |   5 +
 arch/arm64/kvm/emulate-nested.c      | 319 +++++++++++++++++----------
 arch/arm64/kvm/nested.c              |   5 +-
 arch/arm64/kvm/pmu-emul.c            |  97 ++++++--
 arch/arm64/kvm/sys_regs.c            |  12 +-
 include/kvm/arm_pmu.h                |  12 +-
 6 files changed, 311 insertions(+), 139 deletions(-)


base-commit: 7c626ce4bae1ac14f60076d00eafe71af30450ba
-- 
2.46.0.295.g3b9ea8a38a-goog


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

end of thread, other threads:[~2024-08-27 16:40 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-27  0:22 [PATCH v2 00/12] KVM: arm64: nv: More complete support for FEAT_PMUv3 Oliver Upton
2024-08-27  0:22 ` [PATCH v2 01/12] KVM: arm64: Rename kvm_pmu_valid_counter_mask() Oliver Upton
2024-08-27  0:22 ` [PATCH v2 02/12] KVM: arm64: nv: Adjust range of accessible PMCs according to HPMN Oliver Upton
2024-08-27  0:22 ` [PATCH v2 03/12] KVM: arm64: nv: Rename BEHAVE_FORWARD_ANY Oliver Upton
2024-08-27  0:22 ` [PATCH v2 04/12] KVM: arm64: nv: Add support for describing traps that affect Host EL0 Oliver Upton
2024-08-27 16:24   ` Marc Zyngier
2024-08-27  0:22 ` [PATCH v2 05/12] KVM: arm64: nv: Reinject traps that take effect in " Oliver Upton
2024-08-27  0:22 ` [PATCH v2 06/12] KVM: arm64: nv: Honor MDCR_EL2.{TPM, TPMCR} " Oliver Upton
2024-08-27  0:22 ` [PATCH v2 07/12] KVM: arm64: nv: Allow coarse-grained trap combos to use complex traps Oliver Upton
2024-08-27  0:22 ` [PATCH v2 08/12] KVM: arm64: nv: Describe trap behaviour of MDCR_EL2.HPMN Oliver Upton
2024-08-27  0:22 ` [PATCH v2 09/12] KVM: arm64: nv: Advertise support for FEAT_HPMN0 Oliver Upton
2024-08-27 16:40   ` Marc Zyngier
2024-08-27  0:22 ` [PATCH v2 10/12] KVM: arm64: Add helpers to determine if PMC counts at a given EL Oliver Upton
2024-08-27  0:22 ` [PATCH v2 11/12] KVM: arm64: nv: Honor NSH filter when in hyp context Oliver Upton
2024-08-27  0:22 ` [PATCH v2 12/12] KVM: arm64: nv: Reprogram PMU events affected by nested transition Oliver Upton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox