Lines Matching refs:cpuhw
125 struct cpu_hw_events *cpuhw; in validate_ctr_version() local
128 cpuhw = &get_cpu_var(cpu_hw_events); in validate_ctr_version()
134 if (cpuhw->info.cfvn < 1) in validate_ctr_version()
139 if (cpuhw->info.csvn < 1) in validate_ctr_version()
141 if ((cpuhw->info.csvn == 1 && hwc->config > 159) || in validate_ctr_version()
142 (cpuhw->info.csvn == 2 && hwc->config > 175) || in validate_ctr_version()
143 (cpuhw->info.csvn > 2 && hwc->config > 255)) in validate_ctr_version()
154 struct cpu_hw_events *cpuhw; in validate_ctr_auth() local
158 cpuhw = &get_cpu_var(cpu_hw_events); in validate_ctr_auth()
162 if (!(ctrs_state & cpuhw->info.auth_ctl)) in validate_ctr_auth()
176 struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events); in cpumf_pmu_enable() local
179 if (cpuhw->flags & PMU_F_ENABLED) in cpumf_pmu_enable()
182 err = lcctl(cpuhw->state); in cpumf_pmu_enable()
189 cpuhw->flags |= PMU_F_ENABLED; in cpumf_pmu_enable()
199 struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events); in cpumf_pmu_disable() local
203 if (!(cpuhw->flags & PMU_F_ENABLED)) in cpumf_pmu_disable()
206 inactive = cpuhw->state & ~((1 << CPUMF_LCCTL_ENABLE_SHIFT) - 1); in cpumf_pmu_disable()
214 cpuhw->flags &= ~PMU_F_ENABLED; in cpumf_pmu_disable()
227 struct cpu_hw_events *cpuhw; in cpumf_measurement_alert() local
233 cpuhw = this_cpu_ptr(&cpu_hw_events); in cpumf_measurement_alert()
237 if (!(cpuhw->flags & PMU_F_RESERVED)) in cpumf_measurement_alert()
242 qctri(&cpuhw->info); in cpumf_measurement_alert()
253 struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events); in setup_pmc_cpu() local
257 memset(&cpuhw->info, 0, sizeof(cpuhw->info)); in setup_pmc_cpu()
258 qctri(&cpuhw->info); in setup_pmc_cpu()
259 cpuhw->flags |= PMU_F_RESERVED; in setup_pmc_cpu()
263 cpuhw->flags &= ~PMU_F_RESERVED; in setup_pmc_cpu()
478 struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events); in cpumf_pmu_start() local
493 ctr_set_enable(&cpuhw->state, hwc->config_base); in cpumf_pmu_start()
494 ctr_set_start(&cpuhw->state, hwc->config_base); in cpumf_pmu_start()
504 atomic_inc(&cpuhw->ctr_set[hwc->config_base]); in cpumf_pmu_start()
509 struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events); in cpumf_pmu_stop() local
517 if (!atomic_dec_return(&cpuhw->ctr_set[hwc->config_base])) in cpumf_pmu_stop()
518 ctr_set_stop(&cpuhw->state, hwc->config_base); in cpumf_pmu_stop()
530 struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events); in cpumf_pmu_add() local
537 if (!(cpuhw->flags & PERF_EVENT_TXN)) in cpumf_pmu_add()
541 ctr_set_enable(&cpuhw->state, event->hw.config_base); in cpumf_pmu_add()
554 struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events); in cpumf_pmu_del() local
566 if (!atomic_read(&cpuhw->ctr_set[event->hw.config_base])) in cpumf_pmu_del()
567 ctr_set_disable(&cpuhw->state, event->hw.config_base); in cpumf_pmu_del()
578 struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events); in cpumf_pmu_start_txn() local
581 cpuhw->flags |= PERF_EVENT_TXN; in cpumf_pmu_start_txn()
582 cpuhw->tx_state = cpuhw->state; in cpumf_pmu_start_txn()
592 struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events); in cpumf_pmu_cancel_txn() local
594 WARN_ON(cpuhw->tx_state != cpuhw->state); in cpumf_pmu_cancel_txn()
596 cpuhw->flags &= ~PERF_EVENT_TXN; in cpumf_pmu_cancel_txn()
607 struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events); in cpumf_pmu_commit_txn() local
611 state = cpuhw->state & ~((1 << CPUMF_LCCTL_ENABLE_SHIFT) - 1); in cpumf_pmu_commit_txn()
613 if ((state & cpuhw->info.auth_ctl) != state) in cpumf_pmu_commit_txn()
616 cpuhw->flags &= ~PERF_EVENT_TXN; in cpumf_pmu_commit_txn()