All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf/x86/intel/uncore: add event constraint for BDX PCU
@ 2017-11-14 14:06 kan.liang
  2017-11-14 16:09 ` [tip:perf/urgent] perf/x86/intel/uncore: Add " tip-bot for Kan Liang
  0 siblings, 1 reply; 2+ messages in thread
From: kan.liang @ 2017-11-14 14:06 UTC (permalink / raw)
  To: tglx, peterz, mingo, linux-kernel; +Cc: eranian, ak, Kan Liang

From: Kan Liang <kan.liang@intel.com>

Event select bit 7 'Use Occupancy' in PCU Box is not available for
counter 0 on BDX

Add a constraint to fix it.

Reported-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Kan Liang <kan.liang@intel.com>
Tested-by: Stephane Eranian <eranian@google.com>
---
 arch/x86/events/intel/uncore_snbep.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index d5b4398..3991032 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -3034,11 +3034,19 @@ static struct intel_uncore_type *bdx_msr_uncores[] = {
 	NULL,
 };
 
+/* bit 7 'Use Occupancy' is not available for counter 0 on BDX */
+static struct event_constraint bdx_uncore_pcu_constraints[] = {
+	EVENT_CONSTRAINT(0x80, 0xe, 0x80),
+	EVENT_CONSTRAINT_END
+};
+
 void bdx_uncore_cpu_init(void)
 {
 	if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
 		bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
 	uncore_msr_uncores = bdx_msr_uncores;
+
+	hswep_uncore_pcu.constraints = bdx_uncore_pcu_constraints;
 }
 
 static struct intel_uncore_type bdx_uncore_ha = {
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip:perf/urgent] perf/x86/intel/uncore: Add event constraint for BDX PCU
  2017-11-14 14:06 [PATCH] perf/x86/intel/uncore: add event constraint for BDX PCU kan.liang
@ 2017-11-14 16:09 ` tip-bot for Kan Liang
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Kan Liang @ 2017-11-14 16:09 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: eranian, linux-kernel, hpa, kan.liang, tglx, mingo

Commit-ID:  bb9fbe1b57503f790dbbf9f06e72cb0fb9e60740
Gitweb:     https://git.kernel.org/tip/bb9fbe1b57503f790dbbf9f06e72cb0fb9e60740
Author:     Kan Liang <kan.liang@intel.com>
AuthorDate: Tue, 14 Nov 2017 06:06:40 -0800
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Tue, 14 Nov 2017 17:07:49 +0100

perf/x86/intel/uncore: Add event constraint for BDX PCU

Event select bit 7 'Use Occupancy' in PCU Box is not available for
counter 0 on BDX

Add a constraint to fix it.

Reported-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Kan Liang <kan.liang@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Stephane Eranian <eranian@google.com>
Cc: peterz@infradead.org
Cc: ak@linux.intel.com
Link: https://lkml.kernel.org/r/1510668400-301000-1-git-send-email-kan.liang@intel.com

---
 arch/x86/events/intel/uncore_snbep.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 95cb19f..f4e4168 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -3035,11 +3035,19 @@ static struct intel_uncore_type *bdx_msr_uncores[] = {
 	NULL,
 };
 
+/* Bit 7 'Use Occupancy' is not available for counter 0 on BDX */
+static struct event_constraint bdx_uncore_pcu_constraints[] = {
+	EVENT_CONSTRAINT(0x80, 0xe, 0x80),
+	EVENT_CONSTRAINT_END
+};
+
 void bdx_uncore_cpu_init(void)
 {
 	if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
 		bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
 	uncore_msr_uncores = bdx_msr_uncores;
+
+	hswep_uncore_pcu.constraints = bdx_uncore_pcu_constraints;
 }
 
 static struct intel_uncore_type bdx_uncore_ha = {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-14 16:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14 14:06 [PATCH] perf/x86/intel/uncore: add event constraint for BDX PCU kan.liang
2017-11-14 16:09 ` [tip:perf/urgent] perf/x86/intel/uncore: Add " tip-bot for Kan Liang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.