Skip to content

Commit 3096d23

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: Tighten the definition of FEAT_PMUv3p9
The current definition of FEAT_PMUv3p9 doesn't check for the lack of an IMPDEF PMU, which is encoded as 0b1111, but considered unsigned. Use the recently introduced helper to address the issue (which is harmless, as KVM never advertises an IMPDEF PMU). Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent cd64587 commit 3096d23

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

arch/arm64/kvm/config.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ struct reg_bits_to_feat_map {
6666
#define FEAT_BRBE ID_AA64DFR0_EL1, BRBE, IMP
6767
#define FEAT_TRC_SR ID_AA64DFR0_EL1, TraceVer, IMP
6868
#define FEAT_PMUv3 ID_AA64DFR0_EL1, PMUVer, IMP
69-
#define FEAT_PMUv3p9 ID_AA64DFR0_EL1, PMUVer, V3P9
7069
#define FEAT_TRBE ID_AA64DFR0_EL1, TraceBuffer, IMP
7170
#define FEAT_TRBEv1p1 ID_AA64DFR0_EL1, TraceBuffer, TRBE_V1P1
7271
#define FEAT_DoubleLock ID_AA64DFR0_EL1, DoubleLock, IMP
@@ -289,6 +288,11 @@ static bool feat_pmuv3p7(struct kvm *kvm)
289288
return check_pmu_revision(kvm, V3P7);
290289
}
291290

291+
static bool feat_pmuv3p9(struct kvm *kvm)
292+
{
293+
return check_pmu_revision(kvm, V3P9);
294+
}
295+
292296
static bool compute_hcr_rw(struct kvm *kvm, u64 *bits)
293297
{
294298
/* This is purely academic: AArch32 and NV are mutually exclusive */
@@ -747,7 +751,7 @@ static const struct reg_bits_to_feat_map hdfgrtr2_feat_map[] = {
747751
NEEDS_FEAT(HDFGRTR2_EL2_nPMICFILTR_EL0 |
748752
HDFGRTR2_EL2_nPMICNTR_EL0,
749753
FEAT_PMUv3_ICNTR),
750-
NEEDS_FEAT(HDFGRTR2_EL2_nPMUACR_EL1, FEAT_PMUv3p9),
754+
NEEDS_FEAT(HDFGRTR2_EL2_nPMUACR_EL1, feat_pmuv3p9),
751755
NEEDS_FEAT(HDFGRTR2_EL2_nPMSSCR_EL1 |
752756
HDFGRTR2_EL2_nPMSSDATA,
753757
FEAT_PMUv3_SS),
@@ -779,7 +783,7 @@ static const struct reg_bits_to_feat_map hdfgwtr2_feat_map[] = {
779783
FEAT_PMUv3_ICNTR),
780784
NEEDS_FEAT(HDFGWTR2_EL2_nPMUACR_EL1 |
781785
HDFGWTR2_EL2_nPMZR_EL0,
782-
FEAT_PMUv3p9),
786+
feat_pmuv3p9),
783787
NEEDS_FEAT(HDFGWTR2_EL2_nPMSSCR_EL1, FEAT_PMUv3_SS),
784788
NEEDS_FEAT(HDFGWTR2_EL2_nPMIAR_EL1, FEAT_SEBEP),
785789
NEEDS_FEAT(HDFGWTR2_EL2_nPMSDSFR_EL1, feat_spe_fds),

0 commit comments

Comments
 (0)