Page MenuHomeFreeBSD

Conflicting use of CCNT by DEV_PMU and HWPMC
AbandonedPublic

Authored by bz on Oct 13 2015, 5:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 9:40 PM
Unknown Object (File)
Dec 21 2023, 12:28 AM
Unknown Object (File)
Nov 9 2023, 4:38 PM
Unknown Object (File)
Nov 6 2023, 4:02 PM
Unknown Object (File)
Oct 8 2023, 3:33 PM
Unknown Object (File)
Oct 5 2023, 2:55 PM
Unknown Object (File)
Aug 27 2023, 8:04 PM
Unknown Object (File)
Jun 16 2023, 12:06 AM

Details

Reviewers
andrew
br
Summary

In case we compile in device pmu, the kernel will use CCNT when available to expose cycle counts.
In that case we cannot have HWPMC manage that counter (and interrupts for it).
Put safeguards into the HWPMC code to prevent this from happening; in case someone does try to write to it silently accept, and for reading call the generic kernel function.
It is an "artificial" counter on armv7 (and should really be a soft counter), so if worse comes to worse we could just remove it entirely.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

bz retitled this revision from to Conflicting use of CCNT by DEV_PMU and HWPMC.
bz updated this object.
bz edited the test plan for this revision. (Show Details)
bz added reviewers: andrew, br.
bz set the repository for this revision to rS FreeBSD src repository - subversion.
bz added subscribers: pmc, ARM.
emaste added inline comments.
sys/dev/hwpmc/hwpmc_armv7.c
68

Do we have a #define for the 31?

235

Maybe continue here instead?

sys/dev/hwpmc/hwpmc_armv7.c
235

Or invert the logic so we have:

 if (pm_armv7_evsel != 0xFF)
   armv7_pmcn_write(ri, v);
#ifndef DEV_PMU
 else
   cp15_pmccntr_set(v);
#endif

Looking through old reviews and came across this one - what's next?

I think a dependency was rejected. This was Cambridge Teaching material code. I would assume this is overcome by time and changes a lot since. I have no more access to these trees where this came from to see. I am abandoning it to clean up.