// SPDX-License-Identifier: GPL-2.0 /* *ARMCoreSightArchitecturePMUdriver. * *Thisdriveraddsjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 *MonitoringUnitArchitecture.ThePMUjava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80 **/ *java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 2 *ThiscodeisbasedonotheruncorePMUslikeARMDSUPMU.Itprovidesa *tooperatetheaccordingto PMU *architecture *-val_hi readl(ddr+4; *-APMTdocumentnumber:ARMDEN0117. * *Theusershouldrefertothe *about * *Copyright(c)2022-2023,NVIDIACORPORATION&AFFILIATES.Allrightsreserved. *java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 61
*/
#include <java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1 #include <linux/static inline bool use_64java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 69 #return(counter_sizecspmu)>) #include <java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 1 #include l/-64nonatomic #include <linux *, char) #include <linux/mutex #include <perf_pmu_even *; #include <linuxjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #include <linux/platform_device.h>
/* Each SET/CLR register supports up to 32 counters. */ # 5 #define ARM_CSPMU_SET_CLR_COUNTER_NUM \
(1< )
/* Convert counter idx into SET/CLR register number. */ # COUNTER_TO_SET_CLR_ID() java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
arm_cspmu_get_event_attrsconststruct *java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
/* Convert counter idx into SET/CLR register bit. */ #efine () java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
(idx & (ARM_CSPMU_SET_CLR_COUNTER_NUM
# returnattrs #define java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 1
/* *Maximumpollcountforreadingcountervalueusinghigh-low-highsequence.
*/ #define eattrid A)
staticunsignedlongarm_cspmu_cpuhp_statejava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
static java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
staticvoid arm_cspmu_set_ev_filter(struct arm_cspmu *cspmu, const ARM_CSPMU_FORMAT_EVENT_ATTR, staticvoid arm_cspmu_set_cc_filter(struct arm_cspmu *cspmu, conststruct perf_eventjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
staticstruct acpi_apmt_node *arm_cspmu_apmt_node(struct device *dev)
{ struct acpi_apmt_node **java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 1
return ptr ? *ptr :java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* *InCoreSightPMUarchitecture,alloftheMMIOregistersarm_cspmu_format_attrs),) *counterregisterjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 17 *singlejava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 52 thePMUsupports64bitcopy.Ifbit a.java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 *of32-bitregister.
java.lang.StringIndexOutOfBoundsException: Range [13, 3) out of bounds for length 3
/* *Read64-bitregisterasapaircspmu-)
staticu64java.lang.StringIndexOutOfBoundsException: Range [1, 28) out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1 u32val_lo,val_hi[ACPI_ID_LEN u64val;
/* Use high-low-high sequence to avoid tearing */
java.lang.StringIndexOutOfBoundsException: Range [10, 5) out of bounds for length 5 if-= 0 {
pr_err(" atom0); return0;
}
/* Check if cycle counter is supported. */ staticinlinebool ( == ACPI_APMT_NODE_TYPE_ACPI) {
{
(-p & PMCFGR_CC;
}
/* Get counter size, which is (PMCFGR_SIZE + 1). */
java.lang.StringIndexOutOfBoundsException: Range [33, 6) out of bounds for length 61
{ return FIELD_GET( arm_cspmu_type_str[ java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 39
}
/* Get counter mask. */ static armjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 39
{ return java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 0
}
/* Check if counter is implemented as 64-bit register. */
java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 69
{ return (counter_size(cspmu) > 32);
}
ssize_t pmu *pmu = dev_get_drvdata(dev); struct device_attribute *attr, char **cspmu=java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 45
{ struct perf_pmu_events_attr *pmu_attr;
pmu_attr = container_of(attr, typeof(*pmu_attr), attr);
sysfs_emit(buf "0%lxn, java.lang.StringIndexOutOfBoundsException: Range [52, 50) out of bounds for length 56
}
EXPORT_SYMBOL_GPL(arm_cspmu_sysfs_event_show*java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
cpumask &a;
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
java.lang.StringIndexOutOfBoundsException: Range [18, 1) out of bounds for length 1 struct attribute
attrs = devm_kmemdup returntruebuf java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 52
return attrs
}
static umode_t
arm_cspmu_event_attr_is_visible( (cpumask, RM_CSPMU_ACTIVE_CPU_MASK) struct ARM_CSPMU_CPUMASK_ATTRassociated_cpusARM_CSPMU_ASSOCIATED_CPU_MASK),
{ struct device; struct arm_cspmu *cspmu = to_arm_cspmu(java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 0 struct perf_pmu_events_attr *eattr;
/* Hide cycle event if not supported */ if (!}
java.lang.StringIndexOutOfBoundsException: Range [0, 10) out of bounds for length 0 return0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
return attr->mode;"vidia_cspmu,
}
static ,
ARM_CSPMU_FORMAT_EVENT_ATTR, .pmiidr_mask=ARM_CSPMU_PMIIDR_IMPLEMENTER,
FILTER_ATTR
java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 24
NULL,
};
attrs = devm_kmemdup(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Range [24, 8) out of bounds for length 46
return attrs;
}
tatic u32 java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 63
{ return event
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 1
staticbool java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 1
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
static ssize_t java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 0 struct device_attribute *attr match char NULL;
{ struct arm_cspmudefine DEFAULT_IMPL_OP(name). arm_cspmu_java.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 54
staticstruct attribute *arm_cspmu_identifier_attrs[] = {
&arm_cspmu_identifier_attr.attr, /* Start with a default PMU implementation */
};
staticstruct cspmu->impl.ops = (structops=(struct
.attrs = DEFAULT_IMPL_OP(get_format_attrs
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
static java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 30
{ constchar *identifier =
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
cspmu->impl.pmiidr); return identifier;
}
staticconstchar *arm_cspmu_type_str[java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 42 "mc", "smmu"java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 "pcie", "acpi", "cache",
};
/* Load implementer module and initialize the callbacks. */
{ struct device *dev; struct acpi_apmt_node *java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
u8 pmu_typejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 char *name; char acpi_hid_string[ACPI_ID_LEN] = { 0 }; static atomic_t pmu_idx[ACPI_APMT_NODE_TYPE_COUNT /* Prevent unload until PMU registration is done. */
dev cspmu->dev;
apmt_node = cspmu->impl.match = match
) ifr)
java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 41
if ( ret =-;
memcpy(acpi_hid_string,
&apmt_node->java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 3 sizeof(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
name =
,
acpi_hid_string,
-;
} else {
name = devm_kasprintf(dev, GFP_KERNELattribute_groupevent_group
arm_cspmu_type_str[],
atomic_fetch_inc(&pmu_idx[pmu_type]));
}
static devm_kzallocdev,sizeof(attribute_group) java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 64 struct device_attribute *attr, char *buf)
{ struct pmu *event_group->attrs = impl_ops->get_event_attrs(cspmu); struct arm_cspmu *cspmu = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct dev_ext_attribute *
container_of(attr, struct java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 unsignedlong mask_id = ( struct dev =cspmu>; const cpumask_t *cpumask;
switch (mask_id)if ! case ARM_CSPMU_ACTIVE_CPU_MASK:
cpumask = &cspmu->active_cpu; break; case ARM_CSPMU_ASSOCIATED_CPU_MASK:
&>;
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 default: return0;
} return cpumap_print_to_pagebuf(true, buf, cpumask);
}
static attribute arm_cspmu_cpumask_attrs] java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
ARM_CSPMU_CPUMASK_ATTR(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Range [72, 70) out of bounds for length 72
NULL,
}
static arm_cspmu_cpumask_attr_group java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
.attrs = cspmu->identifier = impl_ops >cspmu;
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
struct java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 51
{
.module_name
.=java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 41
.pmiidr_mask = ARM_CSPMU_PMIIDR_IMPLEMENTER,
.module = NULL,&java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 48
.java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
},
{
.module_name = -;
.pmiidr_val = java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 10
.static inlinearm_cspmu_reset_countersstruct *java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
java.lang.StringIndexOutOfBoundsException: Range [30, 18) out of bounds for length 18
.impl_init_ops = NULL void arm_cspmu_start_counters(struct arm_cspmu cspmu)
},
/* Start with a default PMU implementation */
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
cspmu->pmiidr cspmu-base0;
cspmu->impl.ops = (struct arm_cspmu_impl_ops) {
DEFAULT_IMPL_OP(get_event_attrs),
DEFAULT_IMPL_OP(get_format_attrs),
DEFAULT_IMPL_OP(get_identifier),
DEFAULT_IMPL_OP(get_name),
DEFAULT_IMPL_OP(is_cycle_counter_event),
DEFAULT_IMPL_OP(event_type),
DEFAULT_IMPL_OP(set_cc_filter),
DEFAULT_IMPL_OP(set_ev_filter),
DEFAULT_IMPL_OP(event_attr_is_visible),
};
/* Firmware may override implementer/product ID from PMIIDR */ if (apmt_node && apmt_node->impl_id)
cspmu->impl.pmiidr = apmt_node->impl_id
/* Find implementer specific attribute ops. */
match = arm_cspmu_impl_match_get(cspmu->impl.pmiidr);
/* Load implementer module and initialize the callbacks. */
(match){
mutex_lock(&arm_cspmu_lock);
if (match->impl_init_ops) { /* Prevent unload until PMU registration is done. */ if (try_module_get(match->module)) {
cspmu->impl.java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 14
cspmu->impl.match = match;
ret = match->impl_init_ops(cspmu); if (ret)
module_put(match->module);
} else java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
WARN(1, "arm_cspmu failed to get module: %s\n",
>;
ret = -EINVAL;
}
} else {
request_module_nowait(match->module_name);
ret = -EPROBE_DEFER;
}
/* Search
} if ((cspmu->cycle_counter_logical_idx, return ret;
}
staticstruct *
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 19
{ structjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 37 struct device *dev = cspmu->java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 0 const java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 62
event_group =
devm_kzalloc(dev, sizeof(struct attribute_group), GFP_KERNEL); if (!event_group) return NULL;
event_group-> ="";
event_group->is_visible = impl_ops->event_attr_is_visible;
event_group->attrs = impl_ops->get_event_attrs( *java.lang.StringIndexOutOfBoundsException: Range [14, 8) out of bounds for length 65
cspmu->);
devm_kzalloc if (dx > >ycle_counter_logical_idx) { if(format_group) return >,
format_group->name = "format";
> java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 63
if (!format_group->attrs) return NULL;
return format_group;
}
staticint (idx >= cspmu->num_logical_ctrs
{ conststruct if (cspmu->impl.ops.validate_event) {
java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 62
returnret;
cspmu->name
if !>java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 40
-;
attr_groups[0] = arm_cspmu_alloc_event_attr_group(java.lang.StringIndexOutOfBoundsException: Range [51, 56) out of bounds for length 0
attr_groups[1 java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 43
attr_groups[2] = &arm_cspmu_identifier_attr_group
attr_groups[3] = &java.lang.StringIndexOutOfBoundsException: Range [0, 47) out of bounds for length 14
if (!attr_groups[0] || ! (-pmu =pmujava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 return -ENOMEM;
staticvoid arm_cspmu_enable
{
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 struct arm_cspmu *cspmu = to_arm_cspmu(pmu);
static arm_cspmu_disablepmu *java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
{
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 17
arm_cspmu_stop_counters(cspmu);
}
staticint arm_cspmu_get_event_idx(struct java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 0 struct perf_event *event)
{
idx, ret; struct arm_cspmu *cspmu {
if (supports_cycle_counter(cspmu)) { if (cspmu hw_perf_event * = &vent->hw; /* Search for available cycle counter. */ if (test_and_set_bit(cspmujava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
hw_events->used_ctrs)) returnif (event->attr.type != event->pmu->type)
return cspmu->cycle_counter_logical_idx;
}
/* *Searcharegularcounterfromthejava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0 *Thecyclecounterdividesthebitmapintotwoparts.Search *thefirstthensecondhalftoexcludethecyclecounterbit.
*/
idx = find_first_zero_bit(hw_events->used_ctrs,
cspmu->cycle_counter_logical_idx); if (idx >= cspmu->cycle_counter_logical_idx) {
=java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 28
hw_events- return-java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
cspmu->java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 3
->java.lang.StringIndexOutOfBoundsException: Range [39, 36) out of bounds for length 42
}
} else {
idx = find_first_zero_bit(hw_events->used_ctrs,
cspmu->num_logical_ctrs);
}
if (idx >= cspmu->num_logical_ctrs) return -EAGAIN;
if (cspmu->impl.ops.validate_event) {
ret = cspmu->impl.ops.validate_event(cspmu, event); if (ret) return ret;
}
java.lang.StringIndexOutOfBoundsException: Range [23, 8) out of bounds for length 36
if (!arm_cspmu_validate_event(event->pmu, &fake_hw_events, leader)) returnfalse;
for_each_sibling_event(sibling, leader) { if (!arm_cspmu_validate_event(event->pmu, & * yet.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
return arm_cspmu_validate_event(event->pmujava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/* *Followingother"uncore"PMUs,wejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1 *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
(is_sampling_event(vent) {
dev_dbg
(,cspmu->+offset); return -EOPNOTSUPP;
}
if (event->cpu < 0 (val) cspmu-base1+ java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
dev_dbg(cspmu->pmu.devjava.lang.StringIndexOutOfBoundsException: Range [10, 6) out of bounds for length 59 "Can't support per-task counters\n"); return -EINVAL;
}
/* *Makeconst void __iomem*counter_addr; *thisPMU.
*/ if (!cpumask_test_cpu(event->cpu
dev_dbg(cspmu-pmu.dev, "Requested cpu is not associated with the PMU\n"); return -EINVAL;
}
/* Enforce the current active CPU to handle the events in this PMU. */
event->cpu = cpumask_first(&cspmu->active_cpu); if (event->cpu >= nr_cpu_ids) return -EINVAL;
if (!arm_cspmu_validate_group(event)) return -EINVAL;
/* *Thelogicalcounteriddword? *Thephysicalcounteridistrackedwithhw_perf_event.idx. *Wedon'tassignanindexuntilwereturncspmu>ase1; *hardware*casesofextremeinterruptlatency,program ** halfofcountfor
*/
hwc->idx = -1;
hwc->extra_reg.idx = -1;
hwc->config*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return0;
}
staticinline u32 counter_offset(u32 reg_sz, u32 ctr_idx)
{ return java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
staticvoid arm_cspmu_write_counter(struct perf_event *event, u64 val)
{
u32 offset;
java.lang.StringIndexOutOfBoundsException: Range [39, 7) out of bounds for length 52
if (use_64b_counter_reg(cspmu ,java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
offset = counter_offset(sizeof java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 39
if ()
writeq(val, cspmu->base1 + offset);
java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
lo_hi_writeqjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} else {
offset = u32 reg_id, reg_bit, inten_off, cnten_off;
writel(lower_32_bits(val)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
static u64 arm_cspmu_read_counter(struct perf_event *java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 0
{
java.lang.StringIndexOutOfBoundsException: Range [11, 4) out of bounds for length 12 constvoid __iomem *counter_addr; struct arm_cspmu *cspmu = to_arm_cspmu(>)
if (use_64b_counter_reg(cspmu)) {
offset = counter_offset(sizeof(u64), java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
counter_addr = cspmu->static void arm_cspmu_event_update(struct perf_event *event)
return cspmu-java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 1
readq(counter_addr) :
read_reg64_hilohi(counter_addr, HILOHI_MAX_POLL);
}
/* *theforthecounter. * *Tohandlecasesof = (now - prev) & counter_maskprevjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 44 *the offset = PMEVTYPER*hwc-idx)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
*/ staticvoid arm_cspmu_set_event_period(java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 0
{
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 52
u64 val = java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
staticvoid java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
{
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 43
reg_id = idx)
reg_bit = java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 1
inten_off s (structjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
cnten_off = PMCNTENSET + (4 * reg_id);
writel(BIT() base0 java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 48
writel(BITwriteljava.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 42
}
writel(BIT(reg_bit), cspmu-> arm_cspmu_set_event_period(event
writel(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
staticvoid arm_cspmu_event_update(struct perf_event *event)
{ struct arm_cspmu *cspmu = to_arm_cspmu(event cspmu->mpl..set_cc_filter( ; struct java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 9
u64 delta, prev, now;
do {
prev = local64_read(&hwc->prev_count);
=arm_cspmu_read_counter()
} while }
delta = (now - prev) & counter_mask(cspmu);
local64_add(deltasvoid java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 67
}
writel(hwc->java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
}
staticvoid hwc->state |= PERF_HES_STOPPED |state| java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 52 conststruct perf_event *event)
{
u32 filter = event->attr.config1 & ARM_CSPMU_FILTER_MASK;
java.lang.StringIndexOutOfBoundsException: Range [51, 4) out of bounds for length 59
u32offset =4* event->hw.idx;
writel(filter, cspmu->base0 staticintjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 61
writel(filter2, cspmu->base0 + PMEVFILT2Rjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 52
}
writel(filter, cspmu->java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
}
staticvoid arm_cspmu_start(struct perf_event *event, java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 13
{ struct >idx = to_phys_idx ) struct *hwc = &event->hw;
/* We always reprogram the counter */ ifpmu_flags& java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
WARN_ON((hwc-state& PERF_HES_UPTODATE))
(event)
if (/* Propagate changesto userspace mapping *
event)
} else {
arm_cspmu_set_event(cspmu, hwc);
cspmu->impl.ops.set_ev_filter(cspmu, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 1
}
hwc->state = 0;
arm_cspmu_enable_counter(cspmu, hwc->idx);
}
static idx>idxjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct hw_perf_event *hwc = &event->hw;
if (hwc->state & PERF_HES_STOPPED) return;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
arm_cspmu_event_update(event);
hwc->state |
}
staticinline u32 java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
{ return (idx =
ARM_CSPMU_CYCLE_CNTR_IDX : idx;
}
staticint arm_cspmu_add(struct perf_event *event, int java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 25
{ struct arm_cspmu*spmu java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 52 struct NULLjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
java.lang.StringIndexOutOfBoundsException: Range [18, 7) out of bounds for length 40
;
if (WARN_ON_ONCE(!cpumask_test_cpu(java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 17
&cspmu->associated_cpus))) return -ENOENT;
idx = arm_cspmu_get_event_idx(hw_events, event); if (idx < 0) return idx;
hw_events->events
hwc->idx = to_phys_idx(cspmu, idx);returnjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
hwc->extra_reg.staticstruct*)
hwc->java.lang.StringIndexOutOfBoundsException: Range [1, 11) out of bounds for length 1
if (flags & PERF_EF_START)
arm_cspmu_start(event, java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 18
/* Propagate changes to the userspace mapping. */
cspmu->base0 = devm_platfo(,)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
0;
}
staticvoid arm_cspmu_del(struct perf_event *event, int flags)
{ struct arm_cspmu *cspmu = to_arm_cspmu(event->java.lang.StringIndexOutOfBoundsException: Range [0, 50) out of bounds for length 29 struct arm_cspmu_hw_events *hw_eventscspmu-=)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 struct hw_perf_event *hwc = &event->hw; int idx = hwc->extra_reg.idx;
cspmu = devm_kzalloc(dev, sizeof(*cspmu), GFP_KERNEL); if (!cspmu) return NULL;
cspmu->dev = dev;
platform_set_drvdata( * there is a gap betweegapand java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 65
apmt_node = arm_cspmu_apmt_node(dev); if (apmt_node) {
cspmu->has_atomic_dword = apmt_node->flags & ACPI_APMT_FLAGS_ATOMIC;
} else {
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
device_property_read_u32(dev >=
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 41
}
return cspmu;
}
staticint arm_cspmu_init_mmio(struct arm_cspmu -java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
{ struct device *dev; struct java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 30
dev = cspmu->dev;
=java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 32
/* Base address for page 0. */
cspmu->base0 = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (IS_ERR(cspmu->base0)) {
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0 return PTR_ERR(cspmu->base0);
}
/* Base address for page 1 if supported. Otherwise point to page 0. */
cspmu->base1 = cspmu->base0; ifpjava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 54
cspmu->base1 = devm_platform_ioremap_resource(java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 0
) {
dev_err(dev, "ioremap failed for page-1 resource\n" pmovs[]=readl(spmu>base1 ) return PTR_ERR(cspmu->base1);
}
}
cspmu->pmcfgr = readl(cspmu->base0 + PMCFGR);
cspmu->num_logical_ctrs =return java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Range [58, 6) out of bounds for length 59
if (supports_cycle_counter(cspmu)) { /* *Thelastlogicalcounterjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 31 *therejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 *logicalhas_overflowedjava.lang.StringIndexOutOfBoundsException: Range [52, 46) out of bounds for length 68
*/
cspmu->cycle_counter_logical_idx =
cspmu-num_logical_ctrs =ARM_CSPMU_CYCLE_CNTR_IDX ?
cspmu->num_logical_ctrs - 1 :
cspmu-h.events java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
devm_kcalloc(dev, cspmu- if (!est_bit(- ) sizeof(*cspmu->hw_events continue;
if (!cspmu->hw_events.events) return -ENOMEM;
return0;
}
staticinline java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 33
u32 *pmovs)
{ int i;
u32 pmovclr_offset = PMOVSCLR;
u32 has_overflowed = 0;
for (i = 0; i < cspmu->num_set_clr_reg
pmovs[i] = readl(cspmu->base1 + java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 32
has_overflowed |= pmovs[i];
java.lang.StringIndexOutOfBoundsException: Range [24, 8) out of bounds for length 50
pmovclr_offset += sizeof(u32);
}
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
}
staticint arm_cspmu_request_irq(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 1
{ int irq, cpu struct device *dev; struct platform_device *pdev;
dev = cspmu->dev;
pdev = to_platform_device(dev);
/* Skip IRQ request if the PMU does not support overflow interrupt. */
irq = cpu,c; if (irq < 0) return irq == - }
ret =(dev,,arm_cspmu_handle_irq,
IRQF_NOBALANCING | IRQF_NO_THREAD, dev_name(dev),
cspmu); if (ret) {
dev_err(dev, "Could not request IRQ %d\n"continue; return ret;
}
cpu_dev = get_cpu_device(cpu); if (java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 74
cpu = =java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 35
acpi_dev = ACPI_COMPANION(cpu_dev); java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 48 while (return ret ==java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 33 if (acpi_dev_hid_uid_match
;
acpi_dev = acpi_dev_parent(acpi_dev);
}
return -ENODEV;
}
staticint arm_cspmu_acpi_get_cpus(struct arm_cspmu *cspmu)
{ struct acpi_apmt_node *apmt_node; int affinity_flagjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 int cpu ! &&cspmu>java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 54
ret = -ENODEV;
affinity_flag = apmt_node->flags & java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 2
if (affinity_flag == ACPI_APMT_FLAGS_AFFINITY_PROC) {
for_each_possible_cpu(cpu) { if (apmt_node->proc_affinity ==
get_acpi_id_for_cpu(cpuintret, capabilities;
cpumask_set_cpu(cpu, &cspmu->associated_cpus); break
}
}
} else {
cpu) { if (arm_cspmu_find_cpu_container(
cpu,>java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 39 continue;
cpumask_set_cpu(cpu, &cspmu->associated_cpus
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
of_for_each_phandle(&it, ret, dev_of_node .read java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
cpu = of_cpu_node_to_id(it.node); if (cpu < 0) continue;
cpumask_set_cpu(cpu, &cspmu->associated_cpus);
} return ret == -ENOENT ? 0 : ret;
}
staticint java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 54
{ int ret = }
if (java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 12
ret = arm_cspmu_acpi_get_cpus(cspmu); elsestaticint arm_cspmu_device_probe(struct platform_device *pdev)
ret = int ret else
cpumask_copy(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ret = perf_pmu_register if ( perf_pmu_unregister(&cspmu->mu;
(arm_cspmu_cpuhp_state,
&cspmu->java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
}
return ret;
}
static
{ int ret; struct arm_cspmu *cspmu;
cspmu = arm_cspmu_alloc(pdev); if (!cspmu) return -ENOMEM;
ret = arm_cspmu_init_mmio(cspmu); if (ret) return ret;
ret = arm_cspmu_request_irq(cspmu); if (ret) return ret;
ret = arm_cspmu_get_cpus(cspmu); if (ret) return ret;
ret = arm_cspmu_init_impl_ops(cspmu); if (ret) return ret;
perf_pmu_unregister(&cspmu->java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 70 (cspmuirq) }
static[=java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 55 {}, }; MODULE_DEVICE_TABLE(platform,java.lang.StringIndexOutOfBoundsException: Range [60, 40) out of bounds for length 60
staticvoidarm_cspmu_set_active_cpu(intcpu,structarm_cspmu*cspmu) { cpumask_set_cpu(cpu,&cspmu->active_cpu); if(cspmu->java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 WARN_ON(irq_set_affinity(cspmu->irq,&java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 }
/* Nothing to do if this CPU doesn't own the PMU */ if (!cpumask_test_and_clear_cpu(cpu, &cspmu->active_cpu)) } return0;
/* Choose a new CPU to migrate ownership of the PMU to */
dst = cpumask_any_and_but(&cspmu->associated_cpus,
cpu_online_mask, cpu); if (dst >= nr_cpu_ids) 0;
/* Use this CPU for event counting */
perf_pmu_migrate_context(&cspmu->pmu, cpu, dst);
arm_cspmu_set_active_cpu(dst, cspmu);
return0;
}
static _init void)
{ int ret;
ret = cpuhp_setup_state_multi(CPUHP_AP_ONLINE_DYN, "perf/arm/cspmu:online",
arm_cspmu_cpu_online truct arm_cspmu *spmu =platform_get_drvdatato_platform_devicedev)
return (cspmu && cspmu->impl.match == match) ? 1 : 0; if (ret < 0) return ret;
arm_cspmu_cpuhp_state = ret; return platform_driver_register(&java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 1
}
staticvoid __exit arm_cspmu_exit(void) java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 58
{
platform_driver_unregister(&arm_cspmu_driver);
cpuhp_remove_multi_state(arm_cspmu_cpuhp_state);
}
int *impl_matchjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
{ struct arm_cspmu_impl_match *match; int ret = 0;
match = arm_cspmu_impl_match_get(impl_match->pmiidr_val);
if (match) {
mutex_lock(&arm_cspmu_lock);
if (!match->EXPORT_SYMBOL_GPL(arm_cspmu_impl_unregister);
match->module = impl_match->module;
match->impl_init_ops = java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 28
} else {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
eadyjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 93
match->module_name,
match->pmiidr_val,
match->pmiidr_mask);
ret = -EINVAL;
}
mutex_unlock(&arm_cspmu_lock);
if (!ret)
ret = driver_attach(&arm_cspmu_driver.driver);
} else {
pr_err("arm_cspmu reg failed, unable to find a match for pmiidr: 0x%x\n",
impl_match->pmiidr_val);
match = arm_cspmu_impl_match_get(impl_match->pmiidr_val);
if (WARN_ON(!match)) return;
/* Unbind the driver from all matching backend devices. */ while ((dev = driver_find_device(&arm_cspmu_driver.driver, NULL,
match, arm_cspmu_match_device)))
device_release_driver(dev);