From owner-svn-src-all@FreeBSD.ORG Wed Jan 4 07:33:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8834B106566C; Wed, 4 Jan 2012 07:33:07 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7263C8FC17; Wed, 4 Jan 2012 07:33:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q047X7jM066301; Wed, 4 Jan 2012 07:33:07 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q047X7wK066297; Wed, 4 Jan 2012 07:33:07 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201201040733.q047X7wK066297@svn.freebsd.org> From: Fabien Thomas Date: Wed, 4 Jan 2012 07:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229469 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 07:33:07 -0000 Author: fabient Date: Wed Jan 4 07:33:06 2012 New Revision: 229469 URL: http://svn.freebsd.org/changeset/base/229469 Log: Add missing MSR programming for some events. Submitted by: Davide Italiano MFC after: 3 days Modified: head/sys/dev/hwpmc/hwpmc_uncore.c head/sys/dev/hwpmc/hwpmc_uncore.h head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/hwpmc_uncore.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_uncore.c Wed Jan 4 07:25:10 2012 (r229468) +++ head/sys/dev/hwpmc/hwpmc_uncore.c Wed Jan 4 07:33:06 2012 (r229469) @@ -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: head/sys/dev/hwpmc/hwpmc_uncore.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_uncore.h Wed Jan 4 07:25:10 2012 (r229468) +++ head/sys/dev/hwpmc/hwpmc_uncore.h Wed Jan 4 07:33:06 2012 (r229469) @@ -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: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Wed Jan 4 07:25:10 2012 (r229468) +++ head/sys/dev/hwpmc/pmc_events.h Wed Jan 4 07:33:06 2012 (r229469) @@ -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) \