Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Apr 2012 16:14:58 +0000 (UTC)
From:      "George V. Neville-Neil" <gnn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r234062 - in stable/8/sys: dev/hwpmc i386/conf
Message-ID:  <201204091614.q39GEwig068149@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gnn
Date: Mon Apr  9 16:14:58 2012
New Revision: 234062
URL: http://svn.freebsd.org/changeset/base/234062

Log:
  MFC: 232612
  
   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.

Modified:
  stable/8/sys/dev/hwpmc/hwpmc_core.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/boot/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/e1000/   (props changed)
  stable/8/sys/i386/conf/XENHVM   (props changed)

Modified: stable/8/sys/dev/hwpmc/hwpmc_core.c
==============================================================================
--- stable/8/sys/dev/hwpmc/hwpmc_core.c	Mon Apr  9 15:34:23 2012	(r234061)
+++ stable/8/sys/dev/hwpmc/hwpmc_core.c	Mon Apr  9 16:14:58 2012	(r234062)
@@ -1832,7 +1832,7 @@ iap_read_pmc(int cpu, int ri, pmc_value_
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204091614.q39GEwig068149>