summaryrefslogtreecommitdiff
path: root/include/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2022-11-13 19:38:26 +0300
committerMarc Zyngier <maz@kernel.org>2022-11-19 15:56:39 +0300
commit3d0dba5764b94308b8c4257ad64e383f11ce0c92 (patch)
treee8222c5ada162482953e8094ff9408008b9e60e7 /include/kvm
parent26d2d0594d7016dbcbce4038aa202c2858d5a944 (diff)
downloadlinux-3d0dba5764b94308b8c4257ad64e383f11ce0c92.tar.xz
KVM: arm64: PMU: Move the ID_AA64DFR0_EL1.PMUver limit to VM creation
As further patches will enable the selection of a PMU revision from userspace, sample the supported PMU revision at VM creation time, rather than building each time the ID_AA64DFR0_EL1 register is accessed. This shouldn't result in any change in behaviour. Reviewed-by: Reiji Watanabe <reijiw@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20221113163832.3154370-11-maz@kernel.org
Diffstat (limited to 'include/kvm')
-rw-r--r--include/kvm/arm_pmu.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/kvm/arm_pmu.h b/include/kvm/arm_pmu.h
index 96b192139a23..812f729c9108 100644
--- a/include/kvm/arm_pmu.h
+++ b/include/kvm/arm_pmu.h
@@ -89,6 +89,8 @@ void kvm_vcpu_pmu_restore_host(struct kvm_vcpu *vcpu);
vcpu->arch.pmu.events = *kvm_get_pmu_events(); \
} while (0)
+u8 kvm_arm_pmu_get_pmuver_limit(void);
+
#else
struct kvm_pmu {
};
@@ -154,6 +156,10 @@ static inline u64 kvm_pmu_get_pmceid(struct kvm_vcpu *vcpu, bool pmceid1)
static inline void kvm_pmu_update_vcpu_events(struct kvm_vcpu *vcpu) {}
static inline void kvm_vcpu_pmu_restore_guest(struct kvm_vcpu *vcpu) {}
static inline void kvm_vcpu_pmu_restore_host(struct kvm_vcpu *vcpu) {}
+static inline u8 kvm_arm_pmu_get_pmuver_limit(void)
+{
+ return 0;
+}
#endif