Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbsa_acs_pmu.c offsets are inconsistent #431

Open
cdwilde opened this issue Feb 5, 2025 · 0 comments
Open

sbsa_acs_pmu.c offsets are inconsistent #431

cdwilde opened this issue Feb 5, 2025 · 0 comments

Comments

@cdwilde
Copy link

cdwilde commented Feb 5, 2025

REG_PMEVTRYPER is currently set to always have an offset of 4 * mon_inst:
/* Calculate the register offset based on selected monitor */
offset = 4 * mon_inst;

/* Write the received details into PMEVTYPER */
val_mmio_write(base + offset + REG_PMEVTYPER, data);

Later on the file, we calculate the offset based on size:

/* The width of the register PMEVCNTR depends on the size of the largest
implemented counter. if size if PMCFGR.SIZE <= 0b011111, all monitors are
32 bits or smaller else at least one monitor is larger than 32 bits. The
offset is then calculated accordingly. */

if (val_pmu_get_max_monitor_size(node_index) > 0b011111) {
    offset = 8 * mon_inst;
    count = (uint64_t)val_mmio_read(base + offset + REG_PMEVCNTR_H) << 32 |
            val_mmio_read(base + offset + REG_PMEVCNTR_L);
}
else {
    offset = 4 * mon_inst;
    count = val_mmio_read(base + offset + REG_PMEVCNTR);
}

Shouldn't this rule apply to the first offset? We observed failures when we didn't change the offset to 8 * mon_inst.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant