Symbol: smmu_pmu
drivers/perf/arm_smmuv3_pmu.c
140
#define to_smmu_pmu(p) (container_of(p, struct smmu_pmu, pmu))
drivers/perf/arm_smmuv3_pmu.c
156
struct smmu_pmu *smmu_pmu = to_smmu_pmu(pmu);
drivers/perf/arm_smmuv3_pmu.c
159
smmu_pmu->reg_base + SMMU_PMCG_IRQ_CTRL);
drivers/perf/arm_smmuv3_pmu.c
160
writel(SMMU_PMCG_CR_ENABLE, smmu_pmu->reg_base + SMMU_PMCG_CR);
drivers/perf/arm_smmuv3_pmu.c
163
static int smmu_pmu_apply_event_filter(struct smmu_pmu *smmu_pmu,
drivers/perf/arm_smmuv3_pmu.c
168
struct smmu_pmu *smmu_pmu = to_smmu_pmu(pmu);
drivers/perf/arm_smmuv3_pmu.c
171
for_each_set_bit(idx, smmu_pmu->used_counters, smmu_pmu->num_counters)
drivers/perf/arm_smmuv3_pmu.c
172
smmu_pmu_apply_event_filter(smmu_pmu, smmu_pmu->events[idx], idx);
drivers/perf/arm_smmuv3_pmu.c
179
struct smmu_pmu *smmu_pmu = to_smmu_pmu(pmu);
drivers/perf/arm_smmuv3_pmu.c
181
writel(0, smmu_pmu->reg_base + SMMU_PMCG_CR);
drivers/perf/arm_smmuv3_pmu.c
182
writel(0, smmu_pmu->reg_base + SMMU_PMCG_IRQ_CTRL);
drivers/perf/arm_smmuv3_pmu.c
187
struct smmu_pmu *smmu_pmu = to_smmu_pmu(pmu);
drivers/perf/arm_smmuv3_pmu.c
195
for_each_set_bit(idx, smmu_pmu->used_counters, smmu_pmu->num_counters)
drivers/perf/arm_smmuv3_pmu.c
196
writel(0xffff, smmu_pmu->reg_base + SMMU_PMCG_EVTYPER(idx));
drivers/perf/arm_smmuv3_pmu.c
201
static inline void smmu_pmu_counter_set_value(struct smmu_pmu *smmu_pmu,
drivers/perf/arm_smmuv3_pmu.c
204
if (smmu_pmu->counter_mask & BIT(32))
drivers/perf/arm_smmuv3_pmu.c
205
writeq(value, smmu_pmu->reloc_base + SMMU_PMCG_EVCNTR(idx, 8));
drivers/perf/arm_smmuv3_pmu.c
207
writel(value, smmu_pmu->reloc_base + SMMU_PMCG_EVCNTR(idx, 4));
drivers/perf/arm_smmuv3_pmu.c
210
static inline u64 smmu_pmu_counter_get_value(struct smmu_pmu *smmu_pmu, u32 idx)
drivers/perf/arm_smmuv3_pmu.c
214
if (smmu_pmu->counter_mask & BIT(32))
drivers/perf/arm_smmuv3_pmu.c
215
value = readq(smmu_pmu->reloc_base + SMMU_PMCG_EVCNTR(idx, 8));
drivers/perf/arm_smmuv3_pmu.c
217
value = readl(smmu_pmu->reloc_base + SMMU_PMCG_EVCNTR(idx, 4));
drivers/perf/arm_smmuv3_pmu.c
222
static inline void smmu_pmu_counter_enable(struct smmu_pmu *smmu_pmu, u32 idx)
drivers/perf/arm_smmuv3_pmu.c
224
writeq(BIT(idx), smmu_pmu->reg_base + SMMU_PMCG_CNTENSET0);
drivers/perf/arm_smmuv3_pmu.c
227
static inline void smmu_pmu_counter_disable(struct smmu_pmu *smmu_pmu, u32 idx)
drivers/perf/arm_smmuv3_pmu.c
229
writeq(BIT(idx), smmu_pmu->reg_base + SMMU_PMCG_CNTENCLR0);
drivers/perf/arm_smmuv3_pmu.c
232
static inline void smmu_pmu_interrupt_enable(struct smmu_pmu *smmu_pmu, u32 idx)
drivers/perf/arm_smmuv3_pmu.c
234
writeq(BIT(idx), smmu_pmu->reg_base + SMMU_PMCG_INTENSET0);
drivers/perf/arm_smmuv3_pmu.c
237
static inline void smmu_pmu_interrupt_disable(struct smmu_pmu *smmu_pmu,
drivers/perf/arm_smmuv3_pmu.c
240
writeq(BIT(idx), smmu_pmu->reg_base + SMMU_PMCG_INTENCLR0);
drivers/perf/arm_smmuv3_pmu.c
243
static inline void smmu_pmu_set_evtyper(struct smmu_pmu *smmu_pmu, u32 idx,
drivers/perf/arm_smmuv3_pmu.c
246
writel(val, smmu_pmu->reg_base + SMMU_PMCG_EVTYPER(idx));
drivers/perf/arm_smmuv3_pmu.c
249
static inline void smmu_pmu_set_smr(struct smmu_pmu *smmu_pmu, u32 idx, u32 val)
drivers/perf/arm_smmuv3_pmu.c
251
writel(val, smmu_pmu->reg_base + SMMU_PMCG_SMR(idx));
drivers/perf/arm_smmuv3_pmu.c
257
struct smmu_pmu *smmu_pmu = to_smmu_pmu(event->pmu);
drivers/perf/arm_smmuv3_pmu.c
263
now = smmu_pmu_counter_get_value(smmu_pmu, idx);
drivers/perf/arm_smmuv3_pmu.c
268
delta &= smmu_pmu->counter_mask;
drivers/perf/arm_smmuv3_pmu.c
273
static void smmu_pmu_set_period(struct smmu_pmu *smmu_pmu,
drivers/perf/arm_smmuv3_pmu.c
279
if (smmu_pmu->options & SMMU_PMCG_EVCNTR_RDONLY) {
drivers/perf/arm_smmuv3_pmu.c
287
new = smmu_pmu_counter_get_value(smmu_pmu, idx);
drivers/perf/arm_smmuv3_pmu.c
295
new = smmu_pmu->counter_mask >> 1;
drivers/perf/arm_smmuv3_pmu.c
296
smmu_pmu_counter_set_value(smmu_pmu, idx, new);
drivers/perf/arm_smmuv3_pmu.c
305
struct smmu_pmu *smmu_pmu = to_smmu_pmu(event->pmu);
drivers/perf/arm_smmuv3_pmu.c
309
smmu_pmu_set_evtyper(smmu_pmu, idx, evtyper);
drivers/perf/arm_smmuv3_pmu.c
310
smmu_pmu_set_smr(smmu_pmu, idx, sid);
drivers/perf/arm_smmuv3_pmu.c
326
static int smmu_pmu_apply_event_filter(struct smmu_pmu *smmu_pmu,
drivers/perf/arm_smmuv3_pmu.c
330
unsigned int cur_idx, num_ctrs = smmu_pmu->num_counters;
drivers/perf/arm_smmuv3_pmu.c
338
cur_idx = find_first_bit(smmu_pmu->used_counters, num_ctrs);
drivers/perf/arm_smmuv3_pmu.c
343
if (!smmu_pmu->global_filter || cur_idx == num_ctrs) {
drivers/perf/arm_smmuv3_pmu.c
349
if (smmu_pmu_check_global_filter(smmu_pmu->events[cur_idx], event)) {
drivers/perf/arm_smmuv3_pmu.c
350
smmu_pmu_set_evtyper(smmu_pmu, idx, get_event(event));
drivers/perf/arm_smmuv3_pmu.c
357
static int smmu_pmu_get_event_idx(struct smmu_pmu *smmu_pmu,
drivers/perf/arm_smmuv3_pmu.c
361
unsigned int num_ctrs = smmu_pmu->num_counters;
drivers/perf/arm_smmuv3_pmu.c
363
idx = find_first_zero_bit(smmu_pmu->used_counters, num_ctrs);
drivers/perf/arm_smmuv3_pmu.c
368
err = smmu_pmu_apply_event_filter(smmu_pmu, event, idx);
drivers/perf/arm_smmuv3_pmu.c
372
set_bit(idx, smmu_pmu->used_counters);
drivers/perf/arm_smmuv3_pmu.c
398
struct smmu_pmu *smmu_pmu = to_smmu_pmu(event->pmu);
drivers/perf/arm_smmuv3_pmu.c
399
struct device *dev = smmu_pmu->dev;
drivers/perf/arm_smmuv3_pmu.c
420
(!test_bit(event_id, smmu_pmu->supported_events))) {
drivers/perf/arm_smmuv3_pmu.c
430
if (++group_num_events > smmu_pmu->num_counters)
drivers/perf/arm_smmuv3_pmu.c
438
event->cpu = smmu_pmu->on_cpu;
drivers/perf/arm_smmuv3_pmu.c
452
if (++group_num_events > smmu_pmu->num_counters)
drivers/perf/arm_smmuv3_pmu.c
461
struct smmu_pmu *smmu_pmu = to_smmu_pmu(event->pmu);
drivers/perf/arm_smmuv3_pmu.c
467
smmu_pmu_set_period(smmu_pmu, hwc);
drivers/perf/arm_smmuv3_pmu.c
469
smmu_pmu_counter_enable(smmu_pmu, idx);
drivers/perf/arm_smmuv3_pmu.c
474
struct smmu_pmu *smmu_pmu = to_smmu_pmu(event->pmu);
drivers/perf/arm_smmuv3_pmu.c
481
smmu_pmu_counter_disable(smmu_pmu, idx);
drivers/perf/arm_smmuv3_pmu.c
491
struct smmu_pmu *smmu_pmu = to_smmu_pmu(event->pmu);
drivers/perf/arm_smmuv3_pmu.c
493
idx = smmu_pmu_get_event_idx(smmu_pmu, event);
drivers/perf/arm_smmuv3_pmu.c
499
smmu_pmu->events[idx] = event;
drivers/perf/arm_smmuv3_pmu.c
502
smmu_pmu_interrupt_enable(smmu_pmu, idx);
drivers/perf/arm_smmuv3_pmu.c
516
struct smmu_pmu *smmu_pmu = to_smmu_pmu(event->pmu);
drivers/perf/arm_smmuv3_pmu.c
520
smmu_pmu_interrupt_disable(smmu_pmu, idx);
drivers/perf/arm_smmuv3_pmu.c
521
smmu_pmu->events[idx] = NULL;
drivers/perf/arm_smmuv3_pmu.c
522
clear_bit(idx, smmu_pmu->used_counters);
drivers/perf/arm_smmuv3_pmu.c
538
struct smmu_pmu *smmu_pmu = to_smmu_pmu(dev_get_drvdata(dev));
drivers/perf/arm_smmuv3_pmu.c
540
return cpumap_print_to_pagebuf(true, buf, cpumask_of(smmu_pmu->on_cpu));
drivers/perf/arm_smmuv3_pmu.c
586
struct smmu_pmu *smmu_pmu = to_smmu_pmu(dev_get_drvdata(dev));
drivers/perf/arm_smmuv3_pmu.c
591
if (test_bit(pmu_attr->id, smmu_pmu->supported_events))
drivers/perf/arm_smmuv3_pmu.c
607
struct smmu_pmu *smmu_pmu = to_smmu_pmu(dev_get_drvdata(dev));
drivers/perf/arm_smmuv3_pmu.c
609
return sysfs_emit(page, "0x%08x\n", smmu_pmu->iidr);
drivers/perf/arm_smmuv3_pmu.c
617
struct smmu_pmu *smmu_pmu = to_smmu_pmu(dev_get_drvdata(dev));
drivers/perf/arm_smmuv3_pmu.c
619
if (!smmu_pmu->iidr)
drivers/perf/arm_smmuv3_pmu.c
670
struct smmu_pmu *smmu_pmu;
drivers/perf/arm_smmuv3_pmu.c
673
smmu_pmu = hlist_entry_safe(node, struct smmu_pmu, node);
drivers/perf/arm_smmuv3_pmu.c
674
if (cpu != smmu_pmu->on_cpu)
drivers/perf/arm_smmuv3_pmu.c
681
perf_pmu_migrate_context(&smmu_pmu->pmu, cpu, target);
drivers/perf/arm_smmuv3_pmu.c
682
smmu_pmu->on_cpu = target;
drivers/perf/arm_smmuv3_pmu.c
683
WARN_ON(irq_set_affinity(smmu_pmu->irq, cpumask_of(target)));
drivers/perf/arm_smmuv3_pmu.c
690
struct smmu_pmu *smmu_pmu = data;
drivers/perf/arm_smmuv3_pmu.c
695
ovsr = readq(smmu_pmu->reloc_base + SMMU_PMCG_OVSSET0);
drivers/perf/arm_smmuv3_pmu.c
699
writeq(ovsr, smmu_pmu->reloc_base + SMMU_PMCG_OVSCLR0);
drivers/perf/arm_smmuv3_pmu.c
702
for_each_set_bit(idx, ovs, smmu_pmu->num_counters) {
drivers/perf/arm_smmuv3_pmu.c
703
struct perf_event *event = smmu_pmu->events[idx];
drivers/perf/arm_smmuv3_pmu.c
712
smmu_pmu_set_period(smmu_pmu, hwc);
drivers/perf/arm_smmuv3_pmu.c
729
struct smmu_pmu *pmu = dev_get_drvdata(dev);
drivers/perf/arm_smmuv3_pmu.c
740
static void smmu_pmu_setup_msi(struct smmu_pmu *pmu)
drivers/perf/arm_smmuv3_pmu.c
764
static int smmu_pmu_setup_irq(struct smmu_pmu *pmu)
drivers/perf/arm_smmuv3_pmu.c
778
static void smmu_pmu_reset(struct smmu_pmu *smmu_pmu)
drivers/perf/arm_smmuv3_pmu.c
780
u64 counter_present_mask = GENMASK_ULL(smmu_pmu->num_counters - 1, 0);
drivers/perf/arm_smmuv3_pmu.c
782
smmu_pmu_disable(&smmu_pmu->pmu);
drivers/perf/arm_smmuv3_pmu.c
786
smmu_pmu->reg_base + SMMU_PMCG_CNTENCLR0);
drivers/perf/arm_smmuv3_pmu.c
788
smmu_pmu->reg_base + SMMU_PMCG_INTENCLR0);
drivers/perf/arm_smmuv3_pmu.c
790
smmu_pmu->reloc_base + SMMU_PMCG_OVSCLR0);
drivers/perf/arm_smmuv3_pmu.c
793
static void smmu_pmu_get_acpi_options(struct smmu_pmu *smmu_pmu)
drivers/perf/arm_smmuv3_pmu.c
797
model = *(u32 *)dev_get_platdata(smmu_pmu->dev);
drivers/perf/arm_smmuv3_pmu.c
802
smmu_pmu->options |= SMMU_PMCG_EVCNTR_RDONLY | SMMU_PMCG_HARDEN_DISABLE;
drivers/perf/arm_smmuv3_pmu.c
805
smmu_pmu->options |= SMMU_PMCG_HARDEN_DISABLE;
drivers/perf/arm_smmuv3_pmu.c
809
dev_notice(smmu_pmu->dev, "option mask 0x%x\n", smmu_pmu->options);
drivers/perf/arm_smmuv3_pmu.c
812
static bool smmu_pmu_coresight_id_regs(struct smmu_pmu *smmu_pmu)
drivers/perf/arm_smmuv3_pmu.c
814
return of_device_is_compatible(smmu_pmu->dev->of_node,
drivers/perf/arm_smmuv3_pmu.c
818
static void smmu_pmu_get_iidr(struct smmu_pmu *smmu_pmu)
drivers/perf/arm_smmuv3_pmu.c
820
u32 iidr = readl_relaxed(smmu_pmu->reg_base + SMMU_PMCG_IIDR);
drivers/perf/arm_smmuv3_pmu.c
822
if (!iidr && smmu_pmu_coresight_id_regs(smmu_pmu)) {
drivers/perf/arm_smmuv3_pmu.c
823
u32 pidr0 = readl(smmu_pmu->reg_base + SMMU_PMCG_PIDR0);
drivers/perf/arm_smmuv3_pmu.c
824
u32 pidr1 = readl(smmu_pmu->reg_base + SMMU_PMCG_PIDR1);
drivers/perf/arm_smmuv3_pmu.c
825
u32 pidr2 = readl(smmu_pmu->reg_base + SMMU_PMCG_PIDR2);
drivers/perf/arm_smmuv3_pmu.c
826
u32 pidr3 = readl(smmu_pmu->reg_base + SMMU_PMCG_PIDR3);
drivers/perf/arm_smmuv3_pmu.c
827
u32 pidr4 = readl(smmu_pmu->reg_base + SMMU_PMCG_PIDR4);
drivers/perf/arm_smmuv3_pmu.c
844
smmu_pmu->iidr = iidr;
drivers/perf/arm_smmuv3_pmu.c
849
struct smmu_pmu *smmu_pmu;
drivers/perf/arm_smmuv3_pmu.c
857
smmu_pmu = devm_kzalloc(dev, sizeof(*smmu_pmu), GFP_KERNEL);
drivers/perf/arm_smmuv3_pmu.c
858
if (!smmu_pmu)
drivers/perf/arm_smmuv3_pmu.c
861
smmu_pmu->dev = dev;
drivers/perf/arm_smmuv3_pmu.c
862
platform_set_drvdata(pdev, smmu_pmu);
drivers/perf/arm_smmuv3_pmu.c
864
smmu_pmu->pmu = (struct pmu) {
drivers/perf/arm_smmuv3_pmu.c
880
smmu_pmu->reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res_0);
drivers/perf/arm_smmuv3_pmu.c
881
if (IS_ERR(smmu_pmu->reg_base))
drivers/perf/arm_smmuv3_pmu.c
882
return PTR_ERR(smmu_pmu->reg_base);
drivers/perf/arm_smmuv3_pmu.c
884
cfgr = readl_relaxed(smmu_pmu->reg_base + SMMU_PMCG_CFGR);
drivers/perf/arm_smmuv3_pmu.c
888
smmu_pmu->reloc_base = devm_platform_ioremap_resource(pdev, 1);
drivers/perf/arm_smmuv3_pmu.c
889
if (IS_ERR(smmu_pmu->reloc_base))
drivers/perf/arm_smmuv3_pmu.c
890
return PTR_ERR(smmu_pmu->reloc_base);
drivers/perf/arm_smmuv3_pmu.c
892
smmu_pmu->reloc_base = smmu_pmu->reg_base;
drivers/perf/arm_smmuv3_pmu.c
897
smmu_pmu->irq = irq;
drivers/perf/arm_smmuv3_pmu.c
899
ceid_64[0] = readq_relaxed(smmu_pmu->reg_base + SMMU_PMCG_CEID0);
drivers/perf/arm_smmuv3_pmu.c
900
ceid_64[1] = readq_relaxed(smmu_pmu->reg_base + SMMU_PMCG_CEID1);
drivers/perf/arm_smmuv3_pmu.c
901
bitmap_from_arr32(smmu_pmu->supported_events, (u32 *)ceid_64,
drivers/perf/arm_smmuv3_pmu.c
904
smmu_pmu->num_counters = FIELD_GET(SMMU_PMCG_CFGR_NCTR, cfgr) + 1;
drivers/perf/arm_smmuv3_pmu.c
906
smmu_pmu->global_filter = !!(cfgr & SMMU_PMCG_CFGR_SID_FILTER_TYPE);
drivers/perf/arm_smmuv3_pmu.c
909
smmu_pmu->counter_mask = GENMASK_ULL(reg_size, 0);
drivers/perf/arm_smmuv3_pmu.c
911
smmu_pmu_reset(smmu_pmu);
drivers/perf/arm_smmuv3_pmu.c
913
err = smmu_pmu_setup_irq(smmu_pmu);
drivers/perf/arm_smmuv3_pmu.c
919
smmu_pmu_get_iidr(smmu_pmu);
drivers/perf/arm_smmuv3_pmu.c
929
smmu_pmu_get_acpi_options(smmu_pmu);
drivers/perf/arm_smmuv3_pmu.c
936
if (smmu_pmu->options & SMMU_PMCG_HARDEN_DISABLE) {
drivers/perf/arm_smmuv3_pmu.c
937
smmu_pmu->pmu.pmu_enable = smmu_pmu_enable_quirk_hip08_09;
drivers/perf/arm_smmuv3_pmu.c
938
smmu_pmu->pmu.pmu_disable = smmu_pmu_disable_quirk_hip08_09;
drivers/perf/arm_smmuv3_pmu.c
942
smmu_pmu->on_cpu = raw_smp_processor_id();
drivers/perf/arm_smmuv3_pmu.c
943
WARN_ON(irq_set_affinity(smmu_pmu->irq, cpumask_of(smmu_pmu->on_cpu)));
drivers/perf/arm_smmuv3_pmu.c
946
&smmu_pmu->node);
drivers/perf/arm_smmuv3_pmu.c
953
err = perf_pmu_register(&smmu_pmu->pmu, name, -1);
drivers/perf/arm_smmuv3_pmu.c
961
&res_0->start, smmu_pmu->num_counters,
drivers/perf/arm_smmuv3_pmu.c
962
smmu_pmu->global_filter ? "Global(Counter0)" :
drivers/perf/arm_smmuv3_pmu.c
968
cpuhp_state_remove_instance_nocalls(cpuhp_state_num, &smmu_pmu->node);
drivers/perf/arm_smmuv3_pmu.c
974
struct smmu_pmu *smmu_pmu = platform_get_drvdata(pdev);
drivers/perf/arm_smmuv3_pmu.c
976
perf_pmu_unregister(&smmu_pmu->pmu);
drivers/perf/arm_smmuv3_pmu.c
977
cpuhp_state_remove_instance_nocalls(cpuhp_state_num, &smmu_pmu->node);
drivers/perf/arm_smmuv3_pmu.c
982
struct smmu_pmu *smmu_pmu = platform_get_drvdata(pdev);
drivers/perf/arm_smmuv3_pmu.c
984
smmu_pmu_disable(&smmu_pmu->pmu);