aboutsummaryrefslogtreecommitdiffstats
path: root/include/kvm
diff options
context:
space:
mode:
authorShannon Zhao <shannon.zhao@linaro.org>2015-07-03 02:27:25 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2016-02-29 13:34:20 -0500
commit7f7663587165fe1a81c3390358cb70eb7234706f (patch)
tree07b2cb5d5c15e0beac3013f962cead0e6eb04303 /include/kvm
parent96b0eebcc6a14e3bdb9ff0e7176fbfc225bdde94 (diff)
arm64: KVM: PMU: Add perf event map and introduce perf event creating function
When we use tools like perf on host, perf passes the event type and the id of this event type category to kernel, then kernel will map them to hardware event number and write this number to PMU PMEVTYPER<n>_EL0 register. When getting the event number in KVM, directly use raw event type to create a perf_event for it. Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'include/kvm')
-rw-r--r--include/kvm/arm_pmu.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/kvm/arm_pmu.h b/include/kvm/arm_pmu.h
index b70058ef1dd6..c57377970d4e 100644
--- a/include/kvm/arm_pmu.h
+++ b/include/kvm/arm_pmu.h
@@ -43,6 +43,8 @@ void kvm_pmu_set_counter_value(struct kvm_vcpu *vcpu, u64 select_idx, u64 val);
43u64 kvm_pmu_valid_counter_mask(struct kvm_vcpu *vcpu); 43u64 kvm_pmu_valid_counter_mask(struct kvm_vcpu *vcpu);
44void kvm_pmu_disable_counter(struct kvm_vcpu *vcpu, u64 val); 44void kvm_pmu_disable_counter(struct kvm_vcpu *vcpu, u64 val);
45void kvm_pmu_enable_counter(struct kvm_vcpu *vcpu, u64 val); 45void kvm_pmu_enable_counter(struct kvm_vcpu *vcpu, u64 val);
46void kvm_pmu_set_counter_event_type(struct kvm_vcpu *vcpu, u64 data,
47 u64 select_idx);
46#else 48#else
47struct kvm_pmu { 49struct kvm_pmu {
48}; 50};
@@ -61,6 +63,8 @@ static inline u64 kvm_pmu_valid_counter_mask(struct kvm_vcpu *vcpu)
61} 63}
62static inline void kvm_pmu_disable_counter(struct kvm_vcpu *vcpu, u64 val) {} 64static inline void kvm_pmu_disable_counter(struct kvm_vcpu *vcpu, u64 val) {}
63static inline void kvm_pmu_enable_counter(struct kvm_vcpu *vcpu, u64 val) {} 65static inline void kvm_pmu_enable_counter(struct kvm_vcpu *vcpu, u64 val) {}
66static inline void kvm_pmu_set_counter_event_type(struct kvm_vcpu *vcpu,
67 u64 data, u64 select_idx) {}
64#endif 68#endif
65 69
66#endif 70#endif