[PATCH v4 00/18] KVM: arm64: nv: Support for EL2 PMU controls

Oliver Upton posted 18 patches 1 month ago
arch/arm64/include/asm/kvm_arm.h     |  29 ---
arch/arm64/include/asm/kvm_emulate.h |   5 +
arch/arm64/include/asm/kvm_host.h    |  21 +-
arch/arm64/kvm/emulate-nested.c      | 291 ++++++++++++++++-----------
arch/arm64/kvm/nested.c              |  54 ++++-
arch/arm64/kvm/pmu-emul.c            | 143 +++++++++++--
arch/arm64/kvm/sys_regs.c            |  15 +-
arch/arm64/tools/sysreg              |  76 ++++++-
include/kvm/arm_pmu.h                |  18 +-
9 files changed, 465 insertions(+), 187 deletions(-)
[PATCH v4 00/18] KVM: arm64: nv: Support for EL2 PMU controls
Posted by Oliver Upton 1 month ago
v3 -> v4:
 - Align sysreg definitions with DDI0601 2024-09
 - Fix 'accessible' counter mask construction
 - Fix MDCR_EL2.MTPME RES0 logic

v3: https://lore.kernel.org/kvmarm/20241007174559.1830205-1-oliver.upton@linux.dev/

Marc Zyngier (1):
  KVM: arm64: Extend masking facility to arbitrary registers

Oliver Upton (17):
  arm64: sysreg: Describe ID_AA64DFR2_EL1 fields
  arm64: sysreg: Migrate MDCR_EL2 definition to table
  arm64: sysreg: Add new definitions for ID_AA64DFR0_EL1
  KVM: arm64: Describe RES0/RES1 bits of MDCR_EL2
  KVM: arm64: nv: Allow coarse-grained trap combos to use complex traps
  KVM: arm64: nv: Rename BEHAVE_FORWARD_ANY
  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: Describe trap behaviour of MDCR_EL2.HPMN
  KVM: arm64: nv: Advertise support for FEAT_HPMN0
  KVM: arm64: Rename kvm_pmu_valid_counter_mask()
  KVM: arm64: nv: Adjust range of accessible PMCs according to HPMN
  KVM: arm64: Add helpers to determine if PMC counts at a given EL
  KVM: arm64: nv: Honor MDCR_EL2.HPME
  KVM: arm64: nv: Honor MDCR_EL2.HLP
  KVM: arm64: nv: Apply EL2 event filtering when in hyp context
  KVM: arm64: nv: Reprogram PMU events affected by nested transition

 arch/arm64/include/asm/kvm_arm.h     |  29 ---
 arch/arm64/include/asm/kvm_emulate.h |   5 +
 arch/arm64/include/asm/kvm_host.h    |  21 +-
 arch/arm64/kvm/emulate-nested.c      | 291 ++++++++++++++++-----------
 arch/arm64/kvm/nested.c              |  54 ++++-
 arch/arm64/kvm/pmu-emul.c            | 143 +++++++++++--
 arch/arm64/kvm/sys_regs.c            |  15 +-
 arch/arm64/tools/sysreg              |  76 ++++++-
 include/kvm/arm_pmu.h                |  18 +-
 9 files changed, 465 insertions(+), 187 deletions(-)


base-commit: 8e929cb546ee42c9a61d24fae60605e9e3192354
-- 
2.47.0.163.g1226f6d8fa-goog
Re: [PATCH v4 00/18] KVM: arm64: nv: Support for EL2 PMU controls
Posted by Oliver Upton 3 weeks, 3 days ago
On Fri, 25 Oct 2024 18:23:35 +0000, Oliver Upton wrote:
> v3 -> v4:
>  - Align sysreg definitions with DDI0601 2024-09
>  - Fix 'accessible' counter mask construction
>  - Fix MDCR_EL2.MTPME RES0 logic
> 
> v3: https://lore.kernel.org/kvmarm/20241007174559.1830205-1-oliver.upton@linux.dev/
> 
> [...]

Applied to kvmarm/next, thanks!

[01/18] KVM: arm64: Extend masking facility to arbitrary registers
        https://git.kernel.org/kvmarm/kvmarm/c/a0162020095e
[02/18] arm64: sysreg: Describe ID_AA64DFR2_EL1 fields
        https://git.kernel.org/kvmarm/kvmarm/c/93d7356e4b30
[03/18] arm64: sysreg: Migrate MDCR_EL2 definition to table
        https://git.kernel.org/kvmarm/kvmarm/c/641630313e9c
[04/18] arm64: sysreg: Add new definitions for ID_AA64DFR0_EL1
        https://git.kernel.org/kvmarm/kvmarm/c/3ecb1fe3842c
[05/18] KVM: arm64: Describe RES0/RES1 bits of MDCR_EL2
        https://git.kernel.org/kvmarm/kvmarm/c/eb609638da55
[06/18] KVM: arm64: nv: Allow coarse-grained trap combos to use complex traps
        https://git.kernel.org/kvmarm/kvmarm/c/18aeeeb57b93
[07/18] KVM: arm64: nv: Rename BEHAVE_FORWARD_ANY
        https://git.kernel.org/kvmarm/kvmarm/c/a4063b5aa0bd
[08/18] KVM: arm64: nv: Reinject traps that take effect in Host EL0
        https://git.kernel.org/kvmarm/kvmarm/c/d97e66fbcba7
[09/18] KVM: arm64: nv: Honor MDCR_EL2.{TPM, TPMCR} in Host EL0
        https://git.kernel.org/kvmarm/kvmarm/c/4ee5d5ff4b4d
[10/18] KVM: arm64: nv: Describe trap behaviour of MDCR_EL2.HPMN
        https://git.kernel.org/kvmarm/kvmarm/c/336afe0c832d
[11/18] KVM: arm64: nv: Advertise support for FEAT_HPMN0
        https://git.kernel.org/kvmarm/kvmarm/c/166b77a2f423
[12/18] KVM: arm64: Rename kvm_pmu_valid_counter_mask()
        https://git.kernel.org/kvmarm/kvmarm/c/a3034dab74fc
[13/18] KVM: arm64: nv: Adjust range of accessible PMCs according to HPMN
        https://git.kernel.org/kvmarm/kvmarm/c/9a1c58cfefb0
[14/18] KVM: arm64: Add helpers to determine if PMC counts at a given EL
        https://git.kernel.org/kvmarm/kvmarm/c/9d15f8290a22
[15/18] KVM: arm64: nv: Honor MDCR_EL2.HPME
        https://git.kernel.org/kvmarm/kvmarm/c/fe827f916662
[16/18] KVM: arm64: nv: Honor MDCR_EL2.HLP
        https://git.kernel.org/kvmarm/kvmarm/c/16535d55e91f
[17/18] KVM: arm64: nv: Apply EL2 event filtering when in hyp context
        https://git.kernel.org/kvmarm/kvmarm/c/8a34979030f6
[18/18] KVM: arm64: nv: Reprogram PMU events affected by nested transition
        https://git.kernel.org/kvmarm/kvmarm/c/ae323e035801

--
Best,
Oliver
Re: [PATCH v4 00/18] KVM: arm64: nv: Support for EL2 PMU controls
Posted by Marc Zyngier 3 weeks, 5 days ago
On Fri, 25 Oct 2024 19:23:35 +0100,
Oliver Upton <oliver.upton@linux.dev> wrote:
> 
> v3 -> v4:
>  - Align sysreg definitions with DDI0601 2024-09
>  - Fix 'accessible' counter mask construction
>  - Fix MDCR_EL2.MTPME RES0 logic
> 
> v3: https://lore.kernel.org/kvmarm/20241007174559.1830205-1-oliver.upton@linux.dev/
> 
> Marc Zyngier (1):
>   KVM: arm64: Extend masking facility to arbitrary registers
> 
> Oliver Upton (17):
>   arm64: sysreg: Describe ID_AA64DFR2_EL1 fields
>   arm64: sysreg: Migrate MDCR_EL2 definition to table
>   arm64: sysreg: Add new definitions for ID_AA64DFR0_EL1
>   KVM: arm64: Describe RES0/RES1 bits of MDCR_EL2
>   KVM: arm64: nv: Allow coarse-grained trap combos to use complex traps
>   KVM: arm64: nv: Rename BEHAVE_FORWARD_ANY
>   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: Describe trap behaviour of MDCR_EL2.HPMN
>   KVM: arm64: nv: Advertise support for FEAT_HPMN0
>   KVM: arm64: Rename kvm_pmu_valid_counter_mask()
>   KVM: arm64: nv: Adjust range of accessible PMCs according to HPMN
>   KVM: arm64: Add helpers to determine if PMC counts at a given EL
>   KVM: arm64: nv: Honor MDCR_EL2.HPME
>   KVM: arm64: nv: Honor MDCR_EL2.HLP
>   KVM: arm64: nv: Apply EL2 event filtering when in hyp context
>   KVM: arm64: nv: Reprogram PMU events affected by nested transition
> 
>  arch/arm64/include/asm/kvm_arm.h     |  29 ---
>  arch/arm64/include/asm/kvm_emulate.h |   5 +
>  arch/arm64/include/asm/kvm_host.h    |  21 +-
>  arch/arm64/kvm/emulate-nested.c      | 291 ++++++++++++++++-----------
>  arch/arm64/kvm/nested.c              |  54 ++++-
>  arch/arm64/kvm/pmu-emul.c            | 143 +++++++++++--
>  arch/arm64/kvm/sys_regs.c            |  15 +-
>  arch/arm64/tools/sysreg              |  76 ++++++-
>  include/kvm/arm_pmu.h                |  18 +-
>  9 files changed, 465 insertions(+), 187 deletions(-)
> 
> 
> base-commit: 8e929cb546ee42c9a61d24fae60605e9e3192354

I think this is pretty much good to go, and with the couple of nits
mentioned before fixed:

Reviewed-by: Marc Zyngier <maz@kernel.org>

	M.

-- 
Without deviation from the norm, progress is not possible.