Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Apr 2012 20:44:57 +0000 (UTC)
From:      Davide Italiano <davide@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: r234042 - stable/8/sys/dev/hwpmc
Message-ID:  <201204082044.q38Kiveo027550@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davide
Date: Sun Apr  8 20:44:57 2012
New Revision: 234042
URL: http://svn.freebsd.org/changeset/base/234042

Log:
  MFC: r229469
  
  Add missing MSR programming for some events.
  
  Submitted by:	me
  Approved by:	gnn (mentor)

Modified:
  stable/8/sys/dev/hwpmc/hwpmc_uncore.c
  stable/8/sys/dev/hwpmc/hwpmc_uncore.h
  stable/8/sys/dev/hwpmc/pmc_events.h
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/dev/hwpmc/hwpmc_uncore.c
==============================================================================
--- stable/8/sys/dev/hwpmc/hwpmc_uncore.c	Sun Apr  8 20:40:26 2012	(r234041)
+++ stable/8/sys/dev/hwpmc/hwpmc_uncore.c	Sun Apr  8 20:44:57 2012	(r234042)
@@ -545,8 +545,14 @@ static struct ucp_event_descr ucp_events
 
     UCPDESCR(0CH_01H, 0x0C, 0x01, UCP_F_FM | UCP_F_WM),
     UCPDESCR(0CH_02H, 0x0C, 0x02, UCP_F_FM | UCP_F_WM),
-    UCPDESCR(0CH_04H, 0x0C, 0x04, UCP_F_FM | UCP_F_WM),
-    UCPDESCR(0CH_08H, 0x0C, 0x08, UCP_F_FM | UCP_F_WM),
+    UCPDESCR(0CH_04H_E, 0x0C, 0x04, UCP_F_FM | UCP_F_WM),
+    UCPDESCR(0CH_04H_F, 0x0C, 0x04, UCP_F_FM | UCP_F_WM),
+    UCPDESCR(0CH_04H_M, 0x0C, 0x04, UCP_F_FM | UCP_F_WM),
+    UCPDESCR(0CH_04H_S, 0x0C, 0x04, UCP_F_FM | UCP_F_WM),
+    UCPDESCR(0CH_08H_E, 0x0C, 0x08, UCP_F_FM | UCP_F_WM),
+    UCPDESCR(0CH_08H_F, 0x0C, 0x08, UCP_F_FM | UCP_F_WM),
+    UCPDESCR(0CH_08H_M, 0x0C, 0x08, UCP_F_FM | UCP_F_WM),
+    UCPDESCR(0CH_08H_S, 0x0C, 0x08, UCP_F_FM | UCP_F_WM),
 
     UCPDESCR(20H_01H, 0x20, 0x01, UCP_F_FM | UCP_F_I7 | UCP_F_WM),
     UCPDESCR(20H_02H, 0x20, 0x02, UCP_F_FM | UCP_F_I7 | UCP_F_WM),
@@ -965,6 +971,36 @@ ucp_start_pmc(int cpu, int ri)
 	PMCDBG(MDP,STA,2, "ucp-start/2 cpu=%d ri=%d evselmsr=0x%x evsel=0x%x",
 	    cpu, ri, UCP_EVSEL0 + ri, evsel);
 
+	/* Event specific configuration. */
+	switch (pm->pm_event) {
+	case PMC_EV_UCP_EVENT_0CH_04H_E:
+		wrmsr(MSR_GQ_SNOOP_MESF,0x2);
+		break;
+	case PMC_EV_UCP_EVENT_0CH_04H_F:
+		wrmsr(MSR_GQ_SNOOP_MESF,0x8);
+		break;
+	case PMC_EV_UCP_EVENT_0CH_04H_M:
+		wrmsr(MSR_GQ_SNOOP_MESF,0x1);
+		break;
+	case PMC_EV_UCP_EVENT_0CH_04H_S:
+		wrmsr(MSR_GQ_SNOOP_MESF,0x4);
+		break;
+	case PMC_EV_UCP_EVENT_0CH_08H_E:
+		wrmsr(MSR_GQ_SNOOP_MESF,0x2);
+		break;
+	case PMC_EV_UCP_EVENT_0CH_08H_F:
+		wrmsr(MSR_GQ_SNOOP_MESF,0x8);
+		break;	
+	case PMC_EV_UCP_EVENT_0CH_08H_M:
+		wrmsr(MSR_GQ_SNOOP_MESF,0x1);
+		break;
+	case PMC_EV_UCP_EVENT_0CH_08H_S:
+		wrmsr(MSR_GQ_SNOOP_MESF,0x4);
+		break;
+	default:	
+		break;
+	}
+
 	wrmsr(UCP_EVSEL0 + ri, evsel);
 
 	do {

Modified: stable/8/sys/dev/hwpmc/hwpmc_uncore.h
==============================================================================
--- stable/8/sys/dev/hwpmc/hwpmc_uncore.h	Sun Apr  8 20:40:26 2012	(r234041)
+++ stable/8/sys/dev/hwpmc/hwpmc_uncore.h	Sun Apr  8 20:44:57 2012	(r234042)
@@ -87,11 +87,18 @@ struct pmc_md_ucp_op_pmcallocate {
 #define	UC_GLOBAL_CTRL				0x391
 #define	UC_GLOBAL_OVF_CTRL			0x393
 
+
 #define	UC_GLOBAL_STATUS_FLAG_CLRCHG		(1ULL << 63)
 #define	UC_GLOBAL_STATUS_FLAG_OVFPMI		(1ULL << 61)
 #define	UC_GLOBAL_CTRL_FLAG_FRZ			(1ULL << 63)
 #define	UC_GLOBAL_CTRL_FLAG_ENPMICORE0		(1ULL << 48)
 
+/*
+ * Model specific registers.
+ */
+
+#define MSR_GQ_SNOOP_MESF			0x301
+
 struct pmc_md_ucf_pmc {
 	uint64_t	pm_ucf_ctrl;
 };

Modified: stable/8/sys/dev/hwpmc/pmc_events.h
==============================================================================
--- stable/8/sys/dev/hwpmc/pmc_events.h	Sun Apr  8 20:40:26 2012	(r234041)
+++ stable/8/sys/dev/hwpmc/pmc_events.h	Sun Apr  8 20:44:57 2012	(r234042)
@@ -2388,8 +2388,14 @@ __PMC_EV(UCP, EVENT_0BH_10H)			\
 __PMC_EV(UCP, EVENT_0BH_1FH)			\
 __PMC_EV(UCP, EVENT_0CH_01H)			\
 __PMC_EV(UCP, EVENT_0CH_02H)			\
-__PMC_EV(UCP, EVENT_0CH_04H)			\
-__PMC_EV(UCP, EVENT_0CH_08H)			\
+__PMC_EV(UCP, EVENT_0CH_04H_E)			\
+__PMC_EV(UCP, EVENT_0CH_04H_F)			\
+__PMC_EV(UCP, EVENT_0CH_04H_M)			\
+__PMC_EV(UCP, EVENT_0CH_04H_S)			\
+__PMC_EV(UCP, EVENT_0CH_08H_E)			\
+__PMC_EV(UCP, EVENT_0CH_08H_F)			\
+__PMC_EV(UCP, EVENT_0CH_08H_M)			\
+__PMC_EV(UCP, EVENT_0CH_08H_S)			\
 __PMC_EV(UCP, EVENT_20H_01H)			\
 __PMC_EV(UCP, EVENT_20H_02H)			\
 __PMC_EV(UCP, EVENT_20H_04H)			\
@@ -2789,8 +2795,14 @@ __PMC_EV_ALIAS("L3_LINES_OUT.F_STATE", U
 __PMC_EV_ALIAS("L3_LINES_OUT.ANY", UCP_EVENT_0BH_1FH)	\
 __PMC_EV_ALIAS("GQ_SNOOP.GOTO_S", UCP_EVENT_0CH_01H)	\
 __PMC_EV_ALIAS("GQ_SNOOP.GOTO_I", UCP_EVENT_0CH_02H)	\
-__PMC_EV_ALIAS("GQ_SNOOP.GOTO_S_HIT", UCP_EVENT_0CH_04H)	\
-__PMC_EV_ALIAS("GQ_SNOOP.GOTO_I_HIT", UCP_EVENT_0CH_08H)	\
+__PMC_EV_ALIAS("GQ_SNOOP.GOTO_S_HIT_E", UCP_EVENT_0CH_04H_E)	\
+__PMC_EV_ALIAS("GQ_SNOOP.GOTO_S_HIT_F", UCP_EVENT_0CH_04H_F)	\
+__PMC_EV_ALIAS("GQ_SNOOP.GOTO_S_HIT_M", UCP_EVENT_0CH_04H_M)	\
+__PMC_EV_ALIAS("GQ_SNOOP.GOTO_S_HIT_S", UCP_EVENT_0CH_04H_S)	\
+__PMC_EV_ALIAS("GQ_SNOOP.GOTO_I_HIT_E", UCP_EVENT_0CH_08H_E)	\
+__PMC_EV_ALIAS("GQ_SNOOP.GOTO_I_HIT_F", UCP_EVENT_0CH_08H_F)	\
+__PMC_EV_ALIAS("GQ_SNOOP.GOTO_I_HIT_M", UCP_EVENT_0CH_08H_M)	\
+__PMC_EV_ALIAS("GQ_SNOOP.GOTO_I_HIT_S", UCP_EVENT_0CH_08H_S)	\
 __PMC_EV_ALIAS("QHL_REQUESTS.IOH_READS", UCP_EVENT_20H_01H)	\
 __PMC_EV_ALIAS("QHL_REQUESTS.IOH_WRITES", UCP_EVENT_20H_02H)	\
 __PMC_EV_ALIAS("QHL_REQUESTS.REMOTE_READS", UCP_EVENT_20H_04H)	\



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