Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 May 2023 17:49:36 GMT
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d71a43902072 - main - hwpmc: remove remaining UCP event definitions
Message-ID:  <202305061749.346Hnahg017771@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=d71a439020721a9abea5c353b9e03b5dc29d253e

commit d71a439020721a9abea5c353b9e03b5dc29d253e
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2023-05-05 21:56:34 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2023-05-06 17:49:18 +0000

    hwpmc: remove remaining UCP event definitions
    
    Although this block has remained in __PMC_EVENTS(), there is no handling
    of UCP in libpmc/libpmc.c, so it is not possible to select one of these
    events. It should therefore be impossible to trigger the code removed
    from ucp_start_pmc(). Note that the GQ_SNOOP_MSF MSR exists only for
    Nehalem and Westmere architectures, and the related events do not exist
    for later generations.
    
    The Uncore support in hwpmc has severely atrophied in general. We have
    uncore event definitions in pmu-events, but the kernel support was
    written against Intel Performance Measurement Architecture version 2,
    and is disabled for processor generations later than Westmere. Nehalem
    and Westmere lack uncore event definitions in pmu-events. I'd be
    surprised if Uncore support is usable on any machine in its current
    state.
    
    Reviewed by:    jkoshy
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D39901
---
 sys/dev/hwpmc/hwpmc_uncore.c | 21 ---------------------
 sys/dev/hwpmc/pmc_events.h   | 12 ------------
 2 files changed, 33 deletions(-)

diff --git a/sys/dev/hwpmc/hwpmc_uncore.c b/sys/dev/hwpmc/hwpmc_uncore.c
index 577969b47fb7..56373f383dda 100644
--- a/sys/dev/hwpmc/hwpmc_uncore.c
+++ b/sys/dev/hwpmc/hwpmc_uncore.c
@@ -667,27 +667,6 @@ ucp_start_pmc(int cpu, int ri)
 	    "ucp-start/2 cpu=%d ri=%d evselmsr=0x%x evsel=0x%x",
 	    cpu, ri, SELECTSEL(uncore_cputype) + ri, evsel);
 
-	/* Event specific configuration. */
-	switch (pm->pm_event) {
-	case PMC_EV_UCP_EVENT_0CH_04H_E:
-	case PMC_EV_UCP_EVENT_0CH_08H_E:
-		wrmsr(MSR_GQ_SNOOP_MESF,0x2);
-		break;
-	case PMC_EV_UCP_EVENT_0CH_04H_F:
-	case PMC_EV_UCP_EVENT_0CH_08H_F:
-		wrmsr(MSR_GQ_SNOOP_MESF,0x8);
-		break;
-	case PMC_EV_UCP_EVENT_0CH_04H_M:
-	case PMC_EV_UCP_EVENT_0CH_08H_M:
-		wrmsr(MSR_GQ_SNOOP_MESF,0x1);
-		break;
-	case PMC_EV_UCP_EVENT_0CH_04H_S:
-	case PMC_EV_UCP_EVENT_0CH_08H_S:
-		wrmsr(MSR_GQ_SNOOP_MESF,0x4);
-		break;
-	default:
-		break;
-	}
 	wrmsr(SELECTSEL(uncore_cputype) + ri, evsel);
 
 	cc->pc_globalctrl |= (1ULL << ri);
diff --git a/sys/dev/hwpmc/pmc_events.h b/sys/dev/hwpmc/pmc_events.h
index dd31107de9e7..f0839aa49b5b 100644
--- a/sys/dev/hwpmc/pmc_events.h
+++ b/sys/dev/hwpmc/pmc_events.h
@@ -204,16 +204,6 @@ __PMC_EV_ALIAS("instruction-retired",	IAF_INSTR_RETIRED_ANY)		\
 __PMC_EV_ALIAS("unhalted-core-cycles",	IAF_CPU_CLK_UNHALTED_CORE)	\
 __PMC_EV_ALIAS("unhalted-reference-cycles", IAF_CPU_CLK_UNHALTED_REF)
 
-#define        __PMC_EV_UCP()                          \
-	__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)					   \
-
 /*
  * ARMv7 Events
  */
@@ -2477,8 +2467,6 @@ __PMC_EV_ALIAS("unhalted-reference-cycles", IAF_CPU_CLK_UNHALTED_REF)
 	__PMC_EV_K7()				\
 	__PMC_EV_BLOCK(K8,	0x2080)	        \
 	__PMC_EV_K8()				\
-	__PMC_EV_BLOCK(UCP,     0x12080)        \
-	__PMC_EV_UCP()				\
 	__PMC_EV_BLOCK(PPC7450,	0x13000)	\
 	__PMC_EV_PPC7450()			\
 	__PMC_EV_BLOCK(PPC970,	0x13100)	\



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