Skip to contentSkip to conversation

perf/x86/uncore: Fix IVT/SNB-EP uncore CBOX NID filter table

PATCH In review Stephane Eranian 3 participants 5 messages Feb 19, 2014 – Feb 21, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf/x86/uncore: Fix IVT/SNB-EP uncore CBOX NID filter table

This patch updates the CBOX PMU filters mapping tables for SNB-EP and IVT (model 45 and 62 respectively).

The NID umask always comes in addition to another umask. When set, the NID filter is applied.

The current mapping tables were missing some code/umask combinations to account for the NID umask. This patch fixes that.

arch/x86/kernel/cpu/perf_event_intel_uncore.c +9 -1
@@ -501,8 +501,11 @@ static struct extra_reg snbep_uncore_cbox_extra_regs[] = {
 	SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN,
 				  SNBEP_CBO_PMON_CTL_TID_EN, 0x1),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x8),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x8),
@@ -1178,10 +1181,15 @@ static struct extra_reg ivt_uncore_cbox_extra_regs[] = {
 	SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN,
 				  SNBEP_CBO_PMON_CTL_TID_EN, 0x1),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x1031, 0x10ff, 0x2),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x1134, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x5134, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4),
-	SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x10),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x10),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x2135, 0xffff, 0x10),
#1 lore raw
Quoted 6 lines · Stephane Eranian

This patch updates the CBOX PMU filters mapping tables for SNB-EP and IVT (model 45 and 62 respectively).

The NID umask always comes in addition to another umask. When set, the NID filter is applied.

Do you means the NID always applies for LLC_LOOKUP no matter what umask is. If yes, I think it's better to define filter as SNBEP_CBO_EVENT_EXTRA_REG(0x34, 0xff, 0x6)

Regards
Yan, Zheng

Quoted 40 lines

The current mapping tables were missing some code/umask combinations to account for the NID umask. This patch fixes that.

arch/x86/kernel/cpu/perf_event_intel_uncore.c +9 -1
@@ -501,8 +501,11 @@ static struct extra_reg snbep_uncore_cbox_extra_regs[] = {
 	SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN,
 				  SNBEP_CBO_PMON_CTL_TID_EN, 0x1),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x8),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x8),
@@ -1178,10 +1181,15 @@ static struct extra_reg ivt_uncore_cbox_extra_regs[] = {
 	SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN,
 				  SNBEP_CBO_PMON_CTL_TID_EN, 0x1),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x1031, 0x10ff, 0x2),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x1134, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x5134, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4),
-	SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x10),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x10),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x2135, 0xffff, 0x10),
#2 lore raw
Quoted 11 lines · Zheng
Quoted 6 lines · Stephane Eranian

This patch updates the CBOX PMU filters mapping tables for SNB-EP and IVT (model 45 and 62 respectively).

The NID umask always comes in addition to another umask. When set, the NID filter is applied.

Do you means the NID always applies for LLC_LOOKUP no matter what umask is. If yes, I think it's better to define filter as SNBEP_CBO_EVENT_EXTRA_REG(0x34, 0xff, 0x6)

No. I mean you can add NID umask to any other umask but it cannot be used by itself.
In other words, LLC_LOOKUP.NID is not allowed but LLC_LOOKUP.DATA_READ.NID is.

That is what I gathered from the description in the specs.

Quoted 44 lines

Regards
Yan, Zheng

Quoted 40 lines

The current mapping tables were missing some code/umask combinations to account for the NID umask. This patch fixes that.

arch/x86/kernel/cpu/perf_event_intel_uncore.c +9 -1
@@ -501,8 +501,11 @@ static struct extra_reg snbep_uncore_cbox_extra_regs[] = {
      SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN,
                                SNBEP_CBO_PMON_CTL_TID_EN, 0x1),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0x6),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0x6),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0x6),
      SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0x6),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x8),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x8),
@@ -1178,10 +1181,15 @@ static struct extra_reg ivt_uncore_cbox_extra_regs[] = {
      SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN,
                                SNBEP_CBO_PMON_CTL_TID_EN, 0x1),
      SNBEP_CBO_EVENT_EXTRA_REG(0x1031, 0x10ff, 0x2),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x1134, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x5134, 0xffff, 0xc),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0xc),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0xc),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4),
-     SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0xc),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x10),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x10),
      SNBEP_CBO_EVENT_EXTRA_REG(0x2135, 0xffff, 0x10),
Reviewed-by
#3 lore raw
Quoted 9 lines · Stephane Eranian
Quoted 8 lines · Zheng
Quoted 6 lines · Stephane Eranian

This patch updates the CBOX PMU filters mapping tables for SNB-EP and IVT (model 45 and 62 respectively).

The NID umask always comes in addition to another umask. When set, the NID filter is applied.

Quoted 8 lines
Quoted 3 lines

Do you means the NID always applies for LLC_LOOKUP no matter what umask is. If yes, I think it's better to define filter as SNBEP_CBO_EVENT_EXTRA_REG(0x34, 0xff, 0x6)

No. I mean you can add NID umask to any other umask but it cannot be used by itself.
In other words, LLC_LOOKUP.NID is not allowed but LLC_LOOKUP.DATA_READ.NID is.

That is what I gathered from the description in the specs.

Thanks

Quoted 46 lines
Quoted 46 lines

Regards
Yan, Zheng

Quoted 40 lines

The current mapping tables were missing some code/umask combinations to account for the NID umask. This patch fixes that.

arch/x86/kernel/cpu/perf_event_intel_uncore.c +9 -1
@@ -501,8 +501,11 @@ static struct extra_reg snbep_uncore_cbox_extra_regs[] = {
      SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN,
                                SNBEP_CBO_PMON_CTL_TID_EN, 0x1),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0x6),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0x6),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0x6),
      SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0x6),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x8),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x8),
@@ -1178,10 +1181,15 @@ static struct extra_reg ivt_uncore_cbox_extra_regs[] = {
      SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN,
                                SNBEP_CBO_PMON_CTL_TID_EN, 0x1),
      SNBEP_CBO_EVENT_EXTRA_REG(0x1031, 0x10ff, 0x2),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x1134, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x5134, 0xffff, 0xc),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0xc),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0xc),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4),
-     SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc),
+     SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0xc),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x10),
      SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x10),
      SNBEP_CBO_EVENT_EXTRA_REG(0x2135, 0xffff, 0x10),
#4 lore raw

[tip:perf/urgent] perf/x86/uncore: Fix IVT/ SNB-EP uncore CBOX NID filter table

In reply to Stephane Eranian
perf/x86/uncore: Fix IVT/SNB-EP uncore CBOX NID filter table
Commit-ID:  337397f3afc911d94d1d71371a36a53ce218b41f
Gitweb:     http://git.kernel.org/tip/337397f3afc911d94d1d71371a36a53ce218b41f
Author:     Stephane Eranian <[email protected]>
AuthorDate: Wed, 19 Feb 2014 14:10:18 +0100
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Fri, 21 Feb 2014 22:09:01 +0100

perf/x86/uncore: Fix IVT/SNB-EP uncore CBOX NID filter table

This patch updates the CBOX PMU filters mapping tables for SNB-EP and IVT (model 45 and 62 respectively).

The NID umask always comes in addition to another umask. When set, the NID filter is applied.

The current mapping tables were missing some code/umask combinations to account for the NID umask. This patch fixes that.

---
 arch/x86/kernel/cpu/perf_event_intel_uncore.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/perf_event_intel_uncore.c +9 -1
index 29c2487..c88f7f4 100644
@@ -501,8 +501,11 @@ static struct extra_reg snbep_uncore_cbox_extra_regs[] = {
 	SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN,
 				  SNBEP_CBO_PMON_CTL_TID_EN, 0x1),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0x6),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x8),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x8),
@@ -1178,10 +1181,15 @@ static struct extra_reg ivt_uncore_cbox_extra_regs[] = {
 	SNBEP_CBO_EVENT_EXTRA_REG(SNBEP_CBO_PMON_CTL_TID_EN,
 				  SNBEP_CBO_PMON_CTL_TID_EN, 0x1),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x1031, 0x10ff, 0x2),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x1134, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x5134, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0334, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4334, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0534, 0xffff, 0x4),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4534, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0934, 0xffff, 0x4),
-	SNBEP_CBO_EVENT_EXTRA_REG(0x4134, 0xffff, 0xc),
+	SNBEP_CBO_EVENT_EXTRA_REG(0x4934, 0xffff, 0xc),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0135, 0xffff, 0x10),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x0335, 0xffff, 0x10),
 	SNBEP_CBO_EVENT_EXTRA_REG(0x2135, 0xffff, 0x10),