[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1550606411-5313-8-git-send-email-kan.liang@linux.intel.com>
Date: Tue, 19 Feb 2019 12:00:08 -0800
From: kan.liang@...ux.intel.com
To: peterz@...radead.org, tglx@...utronix.de, acme@...nel.org,
mingo@...hat.com, x86@...nel.org, linux-kernel@...r.kernel.org
Cc: len.brown@...el.com, jolsa@...hat.com, namhyung@...nel.org,
eranian@...gle.com, ak@...ux.intel.com,
Kan Liang <kan.liang@...ux.intel.com>
Subject: [PATCH 07/10] perf/x86/intel/uncore: Support die scope counters on CLX-AP
From: Kan Liang <kan.liang@...ux.intel.com>
CLX-AP has the same uncore counters as SKX, but they are die scope.
Add a bool variable to indicate die scope only uncore counters.
Signed-off-by: Kan Liang <kan.liang@...ux.intel.com>
---
arch/x86/events/intel/uncore.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index f795a73..f850ab9 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -20,6 +20,8 @@ static cpumask_t uncore_cpu_mask[DOMAIN_TYPE_MAX];
static unsigned int uncore_domain_type_mask;
+static bool die_only;
+
/* constraint for the fixed counter */
static struct event_constraint uncore_constraint_fixed =
EVENT_CONSTRAINT(~0ULL, 1 << UNCORE_PMC_IDX_FIXED, ~0ULL);
@@ -895,6 +897,9 @@ static int __init uncore_type_init(struct intel_uncore_type *type, bool setid)
if (!pmus)
return -ENOMEM;
+ if (die_only)
+ type->type.type = DIE_DOMAIN;
+
if (domain_type_init(&type->type)) {
kfree(pmus);
return -ENOMEM;
@@ -1503,6 +1508,15 @@ static int __init intel_uncore_init(void)
return -ENODEV;
uncore_init = (struct intel_uncore_init_fun *)id->driver_data;
+
+ /*
+ * CLX-AP has the same uncore counters as SKX,
+ * but they are die scope.
+ */
+ if ((boot_cpu_data.x86_model == INTEL_FAM6_SKYLAKE_X) &&
+ (boot_cpu_data.x86_max_dies > 1))
+ die_only = true;
+
if (uncore_init->pci_init) {
pret = uncore_init->pci_init();
if (!pret)
--
2.7.4
Powered by blists - more mailing lists