aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorAndrew Murray <andrew.murray@arm.com>2019-06-17 15:01:01 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2019-07-05 08:56:04 -0400
commit418e5ca88cc18b7e9eaafa40eac26397ccd66a71 (patch)
treea55fd9495b0394959e46be04709814b53700ea72 /virt
parent11b41626bd5327332f5805ad8f8580365a363067 (diff)
KVM: arm/arm64: Rename kvm_pmu_{enable/disable}_counter functions
The kvm_pmu_{enable/disable}_counter functions can enable/disable multiple counters at once as they operate on a bitmask. Let's make this clearer by renaming the function. Suggested-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Andrew Murray <andrew.murray@arm.com> Reviewed-by: Julien Thierry <julien.thierry@arm.com> Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/arm/pmu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/virt/kvm/arm/pmu.c b/virt/kvm/arm/pmu.c
index da740764a7ee..99e51ee8fd9e 100644
--- a/virt/kvm/arm/pmu.c
+++ b/virt/kvm/arm/pmu.c
@@ -124,13 +124,13 @@ u64 kvm_pmu_valid_counter_mask(struct kvm_vcpu *vcpu)
124} 124}
125 125
126/** 126/**
127 * kvm_pmu_enable_counter - enable selected PMU counter 127 * kvm_pmu_enable_counter_mask - enable selected PMU counters
128 * @vcpu: The vcpu pointer 128 * @vcpu: The vcpu pointer
129 * @val: the value guest writes to PMCNTENSET register 129 * @val: the value guest writes to PMCNTENSET register
130 * 130 *
131 * Call perf_event_enable to start counting the perf event 131 * Call perf_event_enable to start counting the perf event
132 */ 132 */
133void kvm_pmu_enable_counter(struct kvm_vcpu *vcpu, u64 val) 133void kvm_pmu_enable_counter_mask(struct kvm_vcpu *vcpu, u64 val)
134{ 134{
135 int i; 135 int i;
136 struct kvm_pmu *pmu = &vcpu->arch.pmu; 136 struct kvm_pmu *pmu = &vcpu->arch.pmu;
@@ -153,13 +153,13 @@ void kvm_pmu_enable_counter(struct kvm_vcpu *vcpu, u64 val)
153} 153}
154 154
155/** 155/**
156 * kvm_pmu_disable_counter - disable selected PMU counter 156 * kvm_pmu_disable_counter_mask - disable selected PMU counters
157 * @vcpu: The vcpu pointer 157 * @vcpu: The vcpu pointer
158 * @val: the value guest writes to PMCNTENCLR register 158 * @val: the value guest writes to PMCNTENCLR register
159 * 159 *
160 * Call perf_event_disable to stop counting the perf event 160 * Call perf_event_disable to stop counting the perf event
161 */ 161 */
162void kvm_pmu_disable_counter(struct kvm_vcpu *vcpu, u64 val) 162void kvm_pmu_disable_counter_mask(struct kvm_vcpu *vcpu, u64 val)
163{ 163{
164 int i; 164 int i;
165 struct kvm_pmu *pmu = &vcpu->arch.pmu; 165 struct kvm_pmu *pmu = &vcpu->arch.pmu;
@@ -336,10 +336,10 @@ void kvm_pmu_handle_pmcr(struct kvm_vcpu *vcpu, u64 val)
336 336
337 mask = kvm_pmu_valid_counter_mask(vcpu); 337 mask = kvm_pmu_valid_counter_mask(vcpu);
338 if (val & ARMV8_PMU_PMCR_E) { 338 if (val & ARMV8_PMU_PMCR_E) {
339 kvm_pmu_enable_counter(vcpu, 339 kvm_pmu_enable_counter_mask(vcpu,
340 __vcpu_sys_reg(vcpu, PMCNTENSET_EL0) & mask); 340 __vcpu_sys_reg(vcpu, PMCNTENSET_EL0) & mask);
341 } else { 341 } else {
342 kvm_pmu_disable_counter(vcpu, mask); 342 kvm_pmu_disable_counter_mask(vcpu, mask);
343 } 343 }
344 344
345 if (val & ARMV8_PMU_PMCR_C) 345 if (val & ARMV8_PMU_PMCR_C)