Skip to content

Commit a5a6ff3

Browse files
Kan LiangPeter Zijlstra
authored andcommitted
perf/x86/intel/uncore: Fix the bits of the CHA extended umask for SPR
The perf stat errors out with UNC_CHA_TOR_INSERTS.IA_HIT_CXL_ACC_LOCAL event. $perf stat -e uncore_cha_55/event=0x35,umask=0x10c0008101/ -a -- ls event syntax error: '..0x35,umask=0x10c0008101/' \___ Bad event or PMU The definition of the CHA umask is config:8-15,32-55, which is 32bit. However, the umask of the event is bigger than 32bit. This is an error in the original uncore spec. Add a new umask_ext5 for the new CHA umask range. Fixes: 949b113 ("perf/x86/intel/uncore: Add Sapphire Rapids server CHA support") Closes: https://lore.kernel.org/linux-perf-users/alpine.LRH.2.20.2401300733310.11354@Diego/ Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Ian Rogers <irogers@google.com> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20240708185524.1185505-1-kan.liang@linux.intel.com
1 parent 2b84def commit a5a6ff3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/x86/events/intel/uncore_snbep.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@
462462
#define SPR_UBOX_DID 0x3250
463463

464464
/* SPR CHA */
465+
#define SPR_CHA_EVENT_MASK_EXT 0xffffffff
465466
#define SPR_CHA_PMON_CTL_TID_EN (1 << 16)
466467
#define SPR_CHA_PMON_EVENT_MASK (SNBEP_PMON_RAW_EVENT_MASK | \
467468
SPR_CHA_PMON_CTL_TID_EN)
@@ -478,6 +479,7 @@ DEFINE_UNCORE_FORMAT_ATTR(umask_ext, umask, "config:8-15,32-43,45-55");
478479
DEFINE_UNCORE_FORMAT_ATTR(umask_ext2, umask, "config:8-15,32-57");
479480
DEFINE_UNCORE_FORMAT_ATTR(umask_ext3, umask, "config:8-15,32-39");
480481
DEFINE_UNCORE_FORMAT_ATTR(umask_ext4, umask, "config:8-15,32-55");
482+
DEFINE_UNCORE_FORMAT_ATTR(umask_ext5, umask, "config:8-15,32-63");
481483
DEFINE_UNCORE_FORMAT_ATTR(qor, qor, "config:16");
482484
DEFINE_UNCORE_FORMAT_ATTR(edge, edge, "config:18");
483485
DEFINE_UNCORE_FORMAT_ATTR(tid_en, tid_en, "config:19");
@@ -5959,7 +5961,7 @@ static struct intel_uncore_ops spr_uncore_chabox_ops = {
59595961

59605962
static struct attribute *spr_uncore_cha_formats_attr[] = {
59615963
&format_attr_event.attr,
5962-
&format_attr_umask_ext4.attr,
5964+
&format_attr_umask_ext5.attr,
59635965
&format_attr_tid_en2.attr,
59645966
&format_attr_edge.attr,
59655967
&format_attr_inv.attr,
@@ -5995,7 +5997,7 @@ ATTRIBUTE_GROUPS(uncore_alias);
59955997
static struct intel_uncore_type spr_uncore_chabox = {
59965998
.name = "cha",
59975999
.event_mask = SPR_CHA_PMON_EVENT_MASK,
5998-
.event_mask_ext = SPR_RAW_EVENT_MASK_EXT,
6000+
.event_mask_ext = SPR_CHA_EVENT_MASK_EXT,
59996001
.num_shared_regs = 1,
60006002
.constraints = skx_uncore_chabox_constraints,
60016003
.ops = &spr_uncore_chabox_ops,

0 commit comments

Comments
 (0)