Skip to content

Commit bc4000f

Browse files
Kan LiangPeter Zijlstra
authored andcommitted
perf/x86/intel: Add Granite Rapids
From core PMU's perspective, Granite Rapids is similar to the Sapphire Rapids. The key differences include: - Doesn't need the AUX event workaround for the mem load event. (Implement in this patch). - Support Retire Latency (Has been implemented in the commit c87a310 ("perf/x86: Support Retire Latency")) - The event list, which will be supported in the perf tool later. Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20230314170041.2967712-1-kan.liang@linux.intel.com
1 parent e8d018d commit bc4000f

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

arch/x86/events/intel/core.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5469,6 +5469,15 @@ pebs_is_visible(struct kobject *kobj, struct attribute *attr, int i)
54695469
return x86_pmu.pebs ? attr->mode : 0;
54705470
}
54715471

5472+
static umode_t
5473+
mem_is_visible(struct kobject *kobj, struct attribute *attr, int i)
5474+
{
5475+
if (attr == &event_attr_mem_ld_aux.attr.attr)
5476+
return x86_pmu.flags & PMU_FL_MEM_LOADS_AUX ? attr->mode : 0;
5477+
5478+
return pebs_is_visible(kobj, attr, i);
5479+
}
5480+
54725481
static umode_t
54735482
lbr_is_visible(struct kobject *kobj, struct attribute *attr, int i)
54745483
{
@@ -5496,7 +5505,7 @@ static struct attribute_group group_events_td = {
54965505

54975506
static struct attribute_group group_events_mem = {
54985507
.name = "events",
5499-
.is_visible = pebs_is_visible,
5508+
.is_visible = mem_is_visible,
55005509
};
55015510

55025511
static struct attribute_group group_events_tsx = {
@@ -6486,6 +6495,10 @@ __init int intel_pmu_init(void)
64866495

64876496
case INTEL_FAM6_SAPPHIRERAPIDS_X:
64886497
case INTEL_FAM6_EMERALDRAPIDS_X:
6498+
x86_pmu.flags |= PMU_FL_MEM_LOADS_AUX;
6499+
fallthrough;
6500+
case INTEL_FAM6_GRANITERAPIDS_X:
6501+
case INTEL_FAM6_GRANITERAPIDS_D:
64896502
pmem = true;
64906503
x86_pmu.late_ack = true;
64916504
memcpy(hw_cache_event_ids, spr_hw_cache_event_ids, sizeof(hw_cache_event_ids));
@@ -6502,7 +6515,6 @@ __init int intel_pmu_init(void)
65026515
x86_pmu.flags |= PMU_FL_HAS_RSP_1;
65036516
x86_pmu.flags |= PMU_FL_NO_HT_SHARING;
65046517
x86_pmu.flags |= PMU_FL_INSTR_LATENCY;
6505-
x86_pmu.flags |= PMU_FL_MEM_LOADS_AUX;
65066518

65076519
x86_pmu.hw_config = hsw_hw_config;
65086520
x86_pmu.get_event_constraints = spr_get_event_constraints;

0 commit comments

Comments
 (0)