Lines Matching refs:cpuhw

209 	struct cpu_cf_events *cpuhw;
221 cpuhw = p->cpucf;
226 if (!cpuhw)
229 if (refcount_dec_and_test(&cpuhw->refcnt)) {
230 kfree(cpuhw);
241 struct cpu_cf_events *cpuhw;
250 cpuhw = p->cpucf;
252 if (!cpuhw) {
253 cpuhw = kzalloc(sizeof(*cpuhw), GFP_KERNEL);
254 if (cpuhw) {
255 p->cpucf = cpuhw;
256 refcount_set(&cpuhw->refcnt, 1);
261 refcount_inc(&cpuhw->refcnt);
554 static int cfdiag_diffctr(struct cpu_cf_events *cpuhw, unsigned long auth)
562 ctrstart = (struct cf_ctrset_entry *)(cpuhw->start + offset);
563 ctrstop = (struct cf_ctrset_entry *)(cpuhw->stop + offset);
580 trailer_start = (struct cf_trailer_entry *)(cpuhw->start + offset);
581 trailer_stop = (struct cf_trailer_entry *)(cpuhw->stop + offset);
667 struct cpu_cf_events *cpuhw = this_cpu_cfhw();
670 if (!cpuhw || (cpuhw->flags & PMU_F_ENABLED))
673 err = lcctl(cpuhw->state | cpuhw->dev_state);
677 cpuhw->flags |= PMU_F_ENABLED;
687 struct cpu_cf_events *cpuhw = this_cpu_cfhw();
691 if (!cpuhw || !(cpuhw->flags & PMU_F_ENABLED))
694 inactive = cpuhw->state & ~((1 << CPUMF_LCCTL_ENABLE_SHIFT) - 1);
695 inactive |= cpuhw->dev_state;
700 cpuhw->flags &= ~PMU_F_ENABLED;
917 struct cpu_cf_events *cpuhw = this_cpu_cfhw();
927 ctr_set_enable(&cpuhw->state, hwc->config_base);
928 ctr_set_start(&cpuhw->state, hwc->config_base);
936 cpuhw->usedss = cfdiag_getctr(cpuhw->start,
937 sizeof(cpuhw->start),
946 atomic_inc(&cpuhw->ctr_set[i]);
957 struct cpu_cf_events *cpuhw)
972 raw.frag.size = cpuhw->usedss;
973 raw.frag.data = cpuhw->stop;
987 struct cpu_cf_events *cpuhw = this_cpu_cfhw();
999 if (!atomic_dec_return(&cpuhw->ctr_set[i]))
1000 ctr_set_stop(&cpuhw->state, cpumf_ctr_ctl[i]);
1008 cpuhw->usedss = cfdiag_getctr(cpuhw->stop,
1009 sizeof(cpuhw->stop),
1012 if (cfdiag_diffctr(cpuhw, event->hw.config_base))
1013 cfdiag_push_sample(event, cpuhw);
1023 struct cpu_cf_events *cpuhw = this_cpu_cfhw();
1025 ctr_set_enable(&cpuhw->state, event->hw.config_base);
1036 struct cpu_cf_events *cpuhw = this_cpu_cfhw();
1050 if (!atomic_read(&cpuhw->ctr_set[i]))
1051 ctr_set_disable(&cpuhw->state, cpumf_ctr_ctl[i]);
1150 struct cpu_cf_events *cpuhw;
1161 cpuhw = this_cpu_cfhw();
1162 if (!cpuhw)
1308 struct cpu_cf_events *cpuhw = this_cpu_cfhw();
1315 if (!atomic_dec_return(&cpuhw->ctr_set[rc])) {
1316 ctr_set_disable(&cpuhw->dev_state,
1318 ctr_set_stop(&cpuhw->dev_state,
1323 rc = lcctl(cpuhw->dev_state | cpuhw->state);
1326 cpuhw->state, S390_HWCTR_DEVICE, rc);
1327 if (!cpuhw->dev_state)
1328 cpuhw->flags &= ~PMU_F_IN_USE;
1334 struct cpu_cf_events *cpuhw = this_cpu_cfhw();
1338 cpuhw->flags |= PMU_F_IN_USE;
1339 ctr_set_enable(&cpuhw->dev_state, p->sets);
1340 ctr_set_start(&cpuhw->dev_state, p->sets);
1343 atomic_inc(&cpuhw->ctr_set[rc]);
1344 rc = lcctl(cpuhw->dev_state | cpuhw->state); /* Start counter sets */
1349 cpuhw->dev_state | cpuhw->state, S390_HWCTR_DEVICE, rc);
1354 struct cpu_cf_events *cpuhw = this_cpu_cfhw();
1357 cpuhw->dev_state = 0;
1358 rc = lcctl(cpuhw->state); /* Keep perf_event_open counter sets */
1361 cpuhw->state, S390_HWCTR_DEVICE, rc);
1482 struct cpu_cf_events *cpuhw = get_cpu_cfhw(cpu);
1487 rc |= put_user(cpuhw->sets, &ctrset_cpudata->no_sets);
1488 rc |= copy_to_user(ctrset_cpudata->data, cpuhw->data,
1489 cpuhw->used);
1494 uptr += sizeof(struct s390_ctrset_cpudata) + cpuhw->used;
1524 struct cpu_cf_events *cpuhw = this_cpu_cfhw();
1530 cpuhw->used = 0;
1531 cpuhw->sets = 0;
1532 memset(cpuhw->data, 0, sizeof(cpuhw->data));
1536 struct s390_ctrset_setdata *sp = (void *)cpuhw->data +
1537 cpuhw->used;
1542 space = sizeof(cpuhw->data) - cpuhw->used;
1545 cpuhw->used += space;
1546 cpuhw->sets += 1;