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)
Mon, Apr 8, 5:57 AM
Unknown Object (File)
Mon, Apr 8, 2:48 AM
Unknown Object (File)
Mar 1 2024, 11:33 AM
Unknown Object (File)
Feb 4 2024, 11:07 AM
Unknown Object (File)
Jan 25 2024, 10:45 PM
Unknown Object (File)
Jan 14 2024, 5:55 AM
Unknown Object (File)
Jan 11 2024, 7:12 AM
Unknown Object (File)
Dec 20 2023, 1:34 AM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

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
188

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