Page MenuHomeFreeBSD

Conflicting use of CCNT by DEV_PMU and HWPMC
AbandonedPublic

Authored by bz on Oct 13 2015, 5:52 PM.

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
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

bz updated this revision to Diff 9353.Oct 13 2015, 5:52 PM
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.
bz added subscribers: pmc, ARM.
emaste added a subscriber: emaste.Apr 5 2016, 1:54 PM
emaste added inline comments.
sys/dev/hwpmc/hwpmc_armv7.c
68

Do we have a #define for the 31?

235

Maybe continue here instead?

andrew added inline comments.Apr 5 2016, 5:11 PM
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
emaste added a comment.May 6 2019, 8:39 PM

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

bz abandoned this revision.May 6 2019, 8:52 PM

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.