Skip to contentSkip to conversation

perf/x86/intel: Bit 13 is valid for Icelake MSR_OFFCORE_RSP_x register

PATCH RESEND In review Yunying Sun 4 participants 4 messages Jul 24, 2019 – Jul 25, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH RESEND 1/1 perf/x86/intel: Bit 13 is valid for Icelake MSR_OFFCORE_RSP_x register

From Intel SDM, bit 13 of Icelake MSR_OFFCORE_RSP_x register is valid for counting hardware generated prefetches of L3 cache. But current bitmasks in driver takes bit 13 as invalid. Here to fix it.

Before:

$ perf stat -e cpu/event=0xb7,umask=0x1,config1=0x1bfff/u sleep 3
 Performance counter stats for 'sleep 3':
   <not supported>      cpu/event=0xb7,umask=0x1,config1=0x1bfff/u

After:

$ perf stat -e cpu/event=0xb7,umask=0x1,config1=0x1bfff/u sleep 3
 Performance counter stats for 'sleep 3':
             9,293      cpu/event=0xb7,umask=0x1,config1=0x1bfff/u
---
 arch/x86/events/intel/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/events/intel/core.c +2 -2
index 9e911a96972b..b35519cbc8b4 100644
@@ -263,8 +263,8 @@ static struct event_constraint intel_icl_event_constraints[] = {
 };
 
 static struct extra_reg intel_icl_extra_regs[] __read_mostly = {
-	INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffff9fffull, RSP_0),
-	INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffff9fffull, RSP_1),
+	INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffffbfffull, RSP_0),
+	INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffffbfffull, RSP_1),
 	INTEL_UEVENT_PEBS_LDLAT_EXTRA_REG(0x01cd),
 	INTEL_UEVENT_EXTRA_REG(0x01c6, MSR_PEBS_FRONTEND, 0x7fff17, FE),
 	EVENT_EXTRA_END
Signature · 1 line
2.17.0
Reviewed-by on v1 1/1
#2 lore raw
Quoted 9 lines · Yunying Sun

From Intel SDM, bit 13 of Icelake MSR_OFFCORE_RSP_x register is valid for
counting hardware generated prefetches of L3 cache. But current bitmasks in driver takes bit 13 as invalid. Here to fix it.

Before:

$ perf stat -e cpu/event=0xb7,umask=0x1,config1=0x1bfff/u sleep 3
  Performance counter stats for 'sleep 3':
    <not supported>      cpu/event=0xb7,umask=0x1,config1=0x1bfff/u
Quoted 6 lines

After:

$ perf stat -e cpu/event=0xb7,umask=0x1,config1=0x1bfff/u sleep 3
  Performance counter stats for 'sleep 3':
              9,293      cpu/event=0xb7,umask=0x1,config1=0x1bfff/u

Thanks Yunying.

Kan

Quoted 20 lines
---
  arch/x86/events/intel/core.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/events/intel/core.c +2 -2
index 9e911a96972b..b35519cbc8b4 100644
@@ -263,8 +263,8 @@ static struct event_constraint intel_icl_event_constraints[] = {
  };
 
  static struct extra_reg intel_icl_extra_regs[] __read_mostly = {
-	INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffff9fffull, RSP_0),
-	INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffff9fffull, RSP_1),
+	INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffffbfffull, RSP_0),
+	INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffffbfffull, RSP_1),
  	INTEL_UEVENT_PEBS_LDLAT_EXTRA_REG(0x01cd),
  	INTEL_UEVENT_EXTRA_REG(0x01c6, MSR_PEBS_FRONTEND, 0x7fff17, FE),
  	EVENT_EXTRA_END
maintainer
#3 lore raw
Quoted 17 lines · Kan
Quoted 14 lines · Yunying Sun

From Intel SDM, bit 13 of Icelake MSR_OFFCORE_RSP_x register is valid for
counting hardware generated prefetches of L3 cache. But current bitmasks in driver takes bit 13 as invalid. Here to fix it.

Before:

$ perf stat -e cpu/event=0xb7,umask=0x1,config1=0x1bfff/u sleep 3
  Performance counter stats for 'sleep 3':
    <not supported>      cpu/event=0xb7,umask=0x1,config1=0x1bfff/u

After:

$ perf stat -e cpu/event=0xb7,umask=0x1,config1=0x1bfff/u sleep 3
  Performance counter stats for 'sleep 3':
              9,293      cpu/event=0xb7,umask=0x1,config1=0x1bfff/u
Quoted 5 lines
Quoted 1 line

Thanks Yunying.

Thanks!

#4 lore raw

[tip:perf/urgent] perf/x86/intel: Fix invalid Bit 13 for Icelake MSR_OFFCORE_RSP_x register

In reply to Yunying Sun
perf/x86/intel: Fix invalid Bit 13 for Icelake MSR_OFFCORE_RSP_x register
Commit-ID:  3b238a64c3009fed36eaea1af629d9377759d87d
Gitweb:     https://git.kernel.org/tip/3b238a64c3009fed36eaea1af629d9377759d87d
Author:     Yunying Sun <[email protected]>
AuthorDate: Wed, 24 Jul 2019 16:29:32 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 25 Jul 2019 15:41:30 +0200

perf/x86/intel: Fix invalid Bit 13 for Icelake MSR_OFFCORE_RSP_x register

The Intel SDM states that bit 13 of Icelake's MSR_OFFCORE_RSP_x register is valid, and used for counting hardware generated prefetches of L3 cache. Update the bitmask to allow bit 13.

Before:

$ perf stat -e cpu/event=0xb7,umask=0x1,config1=0x1bfff/u sleep 3
 Performance counter stats for 'sleep 3':
   <not supported>      cpu/event=0xb7,umask=0x1,config1=0x1bfff/u

After:

$ perf stat -e cpu/event=0xb7,umask=0x1,config1=0x1bfff/u sleep 3
 Performance counter stats for 'sleep 3':
             9,293      cpu/event=0xb7,umask=0x1,config1=0x1bfff/u
---
 arch/x86/events/intel/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/events/intel/core.c +2 -2
index 9e911a96972b..b35519cbc8b4 100644
@@ -263,8 +263,8 @@ static struct event_constraint intel_icl_event_constraints[] = {
 };
 
 static struct extra_reg intel_icl_extra_regs[] __read_mostly = {
-	INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffff9fffull, RSP_0),
-	INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffff9fffull, RSP_1),
+	INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffffbfffull, RSP_0),
+	INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffffbfffull, RSP_1),
 	INTEL_UEVENT_PEBS_LDLAT_EXTRA_REG(0x01cd),
 	INTEL_UEVENT_EXTRA_REG(0x01c6, MSR_PEBS_FRONTEND, 0x7fff17, FE),
 	EVENT_EXTRA_END