Page MenuHomeFreeBSD

hwpmc_arm64: accept raw event codes for PMC_OP_PMCALLOCATE
ClosedPublic

Authored by mhorne on Jun 1 2021, 4:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 9:22 AM
Unknown Object (File)
Mon, Oct 14, 8:41 PM
Unknown Object (File)
Mon, Oct 14, 8:41 PM
Unknown Object (File)
Oct 2 2024, 5:47 AM
Unknown Object (File)
Sep 23 2024, 6:34 AM
Unknown Object (File)
Sep 21 2024, 4:55 AM
Unknown Object (File)
Sep 17 2024, 8:31 AM
Unknown Object (File)
Sep 14 2024, 4:55 PM
Subscribers

Details

Summary

Relax the validation added in 24b2f4ea4922 slightly, to allow for raw
event codes obtained from the pmu-events table.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 39649
Build 36538: arc lint + arc unit

Event Timeline

mhorne requested review of this revision.Jun 1 2021, 4:20 PM
ray added inline comments.
sys/dev/hwpmc/hwpmc_arm64.c
192

I'm not 100% sure, but maybe better to fix requester?

Is there a way to tell if a raw event or event code has been asked for on the syscall boundary? In current architecture the event space is 16bit so we can tell the difference, however we shouldn't assume this will never change.

sys/dev/hwpmc/hwpmc_arm64.c
189

If we are allowing raw events here could we allow the full 16 bit event space? (10 bit in Armv8.0)

Is there a way to tell if a raw event or event code has been asked for on the syscall boundary? In current architecture the event space is 16bit so we can tell the difference, however we shouldn't assume this will never change.

There is no way to tell precisely with the current scheme, but I see two ways we might detect this. We can add a new flag, PMC_F_EVENTCODE_RAW and always apply this for pmu-events allocations, or we can add a field to pmc_md_op_pmcallocate for the raw event code. There seems to be more precedent for the latter.

Provide an MD field, pm_has_raw_event, to inform when the event code is raw.

This revision is now accepted and ready to land.Jun 23 2021, 9:28 PM