svn commit: r233810 - in stable/9/sys: dev/hwpmc i386/conf

George V. Neville-Neil gnn at FreeBSD.org
Mon Apr 2 20:10:51 UTC 2012


Author: gnn
Date: Mon Apr  2 20:10:50 2012
New Revision: 233810
URL: http://svn.freebsd.org/changeset/base/233810

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/9/sys/dev/hwpmc/hwpmc_core.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/i386/conf/XENHVM   (props changed)

Modified: stable/9/sys/dev/hwpmc/hwpmc_core.c
==============================================================================
--- stable/9/sys/dev/hwpmc/hwpmc_core.c	Mon Apr  2 19:35:36 2012	(r233809)
+++ stable/9/sys/dev/hwpmc/hwpmc_core.c	Mon Apr  2 20:10:50 2012	(r233810)
@@ -1833,7 +1833,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);


More information about the svn-src-all mailing list