Properly mask off bits that are not supported in the IAP counters.

This fixes a bug where users would see massively large counts, near
to 2**64 -1, due to the bits not being cleared.

MFC after:	3 weeks
This commit is contained in:
George V. Neville-Neil 2012-03-06 17:17:03 +00:00
parent 2460e894e3
commit a7ef8bbb2f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232612

View File

@ -2021,7 +2021,7 @@ iap_read_pmc(int cpu, int ri, pmc_value_t *v)
if (PMC_IS_SAMPLING_MODE(PMC_TO_MODE(pm)))
*v = iap_perfctr_value_to_reload_count(tmp);
else
*v = tmp;
*v = tmp & ((1ULL << core_iap_width) - 1);
PMCDBG(MDP,REA,1, "iap-read cpu=%d ri=%d msr=0x%x -> v=%jx", cpu, ri,
ri, *v);