Lines Matching defs:counter
39 * kvm_pmu_idx_is_64bit - determine if select_idx is a 64bit counter
41 * @select_idx: The counter index
62 * @pmc: The PMU counter pointer
72 * kvm_pmu_idx_is_high_counter - determine if select_idx is a high/low counter
73 * @select_idx: The counter index
82 * @pmc: The PMU counter pointer
84 * When a pair of PMCs are chained together we use the low counter (canonical)
106 * @select_idx: The counter index
124 * kvm_pmu_get_pair_counter_value - get PMU counter value
126 * @pmc: The PMU counter pointer
131 u64 counter, counter_high, reg, enabled, running;
137 counter = __vcpu_sys_reg(vcpu, reg);
140 counter = lower_32_bits(counter) | (counter_high << 32);
144 counter = __vcpu_sys_reg(vcpu, reg);
148 * The real counter value is equal to the value of counter register plus
152 counter += perf_event_read_value(pmc->perf_event, &enabled,
155 return counter;
159 * kvm_pmu_get_counter_value - get PMU counter value
161 * @select_idx: The counter index
165 u64 counter;
169 counter = kvm_pmu_get_pair_counter_value(vcpu, pmc);
173 counter = upper_32_bits(counter);
175 counter = lower_32_bits(counter);
177 return counter;
181 * kvm_pmu_set_counter_value - set PMU counter value
183 * @select_idx: The counter index
184 * @val: The counter value
200 * @pmc: The PMU counter pointer
213 * kvm_pmu_stop_counter - stop PMU counter
214 * @pmc: The PMU counter pointer
216 * If this counter has been configured to monitor some event, release it here.
220 u64 counter, reg, val;
226 counter = kvm_pmu_get_pair_counter_value(vcpu, pmc);
230 val = counter;
233 val = lower_32_bits(counter);
239 __vcpu_sys_reg(vcpu, reg + 1) = upper_32_bits(counter);
245 * kvm_pmu_vcpu_init - assign pmu counter idx for cpu
485 * i.e. the point where the counter overflows.
538 /* increment this even SW_INC counter */
547 /* increment the high counter */
551 if (!reg) /* mark overflow on the high counter */
554 /* mark overflow on low counter */
594 * kvm_pmu_create_perf_event - create a perf event for a counter
596 * @select_idx: The number of selected counter
604 u64 eventsel, counter, reg, data;
608 * obtained from the low/even counter. We also use this counter to
646 counter = kvm_pmu_get_pair_counter_value(vcpu, pmc);
652 * high counter.
654 attr.sample_period = (-counter) & GENMASK(63, 0);
663 attr.sample_period = (-counter) & GENMASK(63, 0);
665 attr.sample_period = (-counter) & GENMASK(31, 0);
683 * @select_idx: The number of selected counter
706 * the adjacent counter is stopped and its event destroyed
716 * kvm_pmu_set_counter_event_type - set selected counter to monitor some event
719 * @select_idx: The number of selected counter