Skip to content

KVM: arm64: Handle hidden FEAT_PMUv3 in ID_AA64DFR0_EL1

Colton Lewis kvm kvmarm linux-arm-kernel lkml 1 version Applied

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest2 patches 1 replyApplied

Changes in v2 from the cover letter

- Handle ID_AA64DFR0_EL1_PMUVer_NI in __kvm_pmu_event_mask() and drop
the kvm_vcpu_has_pmu() check in reset_pmevtyper() (Oliver)
- Drop Cc: [email protected] (Oliver)
- Add patch 2 to check ID_AA64DFR0_EL1.PMUVer in pmu_visibility() (Oliver)
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2KVM: arm64: Handle ID_AA64DFR0_EL1.PMUVer == NI in __kvm_pmu_event_mask()arch/arm64/kvm/pmu-emul.c arch/arm64/kvm/sys_regs.c+4 -50 replies
2/2KVM: arm64: Check ID_AA64DFR0_EL1.PMUVer in pmu_visibility()arch/arm64/kvm/sys_regs.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] KVM: arm64: Handle hidden FEAT_PMUv3 in ID_AA64DFR0_EL1

When userspace initializes a vCPU with KVM_ARM_VCPU_PMU_V3 and hides FEAT_PMUv3 via ID_AA64DFR0_EL1.PMUVer, KVM hits a WARN_ONCE("Unknown PMU version 0") during reset_pmevtyper() and continues to expose PMU system registers instead of emulating guest accesses as UNDEF.

Patch 1 handles ID_AA64DFR0_EL1_PMUVer_NI in __kvm_pmu_event_mask() and removes the redundant kvm_vcpu_has_pmu() check in reset_pmevtyper(). Patch 2 updates pmu_visibility() to check ID_AA64DFR0_EL1.PMUVer via kvm_has_feat() so PMU registers are marked REG_HIDDEN when FEAT_PMUv3 is not advertised.

Changes in v2:
- Handle ID_AA64DFR0_EL1_PMUVer_NI in __kvm_pmu_event_mask() and drop
the kvm_vcpu_has_pmu() check in reset_pmevtyper() (Oliver)
- Drop Cc: [email protected] (Oliver)
- Add patch 2 to check ID_AA64DFR0_EL1.PMUVer in pmu_visibility() (Oliver)
- Link to v1: https://lore.kernel.org/r/[email protected]

Colton Lewis (2):
KVM: arm64: Handle ID_AA64DFR0_EL1.PMUVer == NI in

    __kvm_pmu_event_mask()

KVM: arm64: Check ID_AA64DFR0_EL1.PMUVer in pmu_visibility()

 arch/arm64/kvm/pmu-emul.c | 5 ++++-
 arch/arm64/kvm/sys_regs.c | 6 +-----
 2 files changed, 5 insertions(+), 6 deletions(-)
Signature · 1 line
2.56.0.rc1.315.gc6ed9934b7-goog