aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorGeorge V. Neville-Neil <gnn@FreeBSD.org>2012-03-06 17:17:03 +0000
committerGeorge V. Neville-Neil <gnn@FreeBSD.org>2012-03-06 17:17:03 +0000
commita7ef8bbb2fef1d098b572c8d26a9118c476ddc4b (patch)
treed690e6a6794ad0663df3268b8fe35cc87259d21c /sys
parent2460e894e3de2136dde33e1a02e5fba7baba498a (diff)
downloadsrc-a7ef8bbb2fef1d098b572c8d26a9118c476ddc4b.tar.gz
src-a7ef8bbb2fef1d098b572c8d26a9118c476ddc4b.zip
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
Notes
Notes: svn path=/head/; revision=232612
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/hwpmc/hwpmc_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c
index a3e3cb9ddefb..7bef54811ddb 100644
--- a/sys/dev/hwpmc/hwpmc_core.c
+++ b/sys/dev/hwpmc/hwpmc_core.c
@@ -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);