Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Apr 2012 20:10:51 +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-9@freebsd.org
Subject:   svn commit: r233810 - in stable/9/sys: dev/hwpmc i386/conf
Message-ID:  <201204022010.q32KAp24014798@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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