@@ -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+
54725481static umode_t
54735482lbr_is_visible (struct kobject * kobj , struct attribute * attr , int i )
54745483{
@@ -5496,7 +5505,7 @@ static struct attribute_group group_events_td = {
54965505
54975506static struct attribute_group group_events_mem = {
54985507 .name = "events" ,
5499- .is_visible = pebs_is_visible ,
5508+ .is_visible = mem_is_visible ,
55005509};
55015510
55025511static 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