Skip to content

Commit 782cffe

Browse files
Kan LiangPeter Zijlstra
authored andcommitted
perf/x86/intel: Fix event constraints for LNC
According to the latest event list, update the event constraint tables for Lion Cove core. The general rule (the event codes < 0x90 are restricted to counters 0-3.) has been removed. There is no restriction for most of the performance monitoring events. Fixes: a932aa0 ("perf/x86: Add Lunar Lake and Arrow Lake support") Reported-by: Amiri Khalil <amiri.khalil@intel.com> Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20250219141005.2446823-1-kan.liang@linux.intel.com
1 parent ec5fd50 commit 782cffe

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

arch/x86/events/intel/core.c

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -397,34 +397,28 @@ static struct event_constraint intel_lnc_event_constraints[] = {
397397
METRIC_EVENT_CONSTRAINT(INTEL_TD_METRIC_FETCH_LAT, 6),
398398
METRIC_EVENT_CONSTRAINT(INTEL_TD_METRIC_MEM_BOUND, 7),
399399

400+
INTEL_EVENT_CONSTRAINT(0x20, 0xf),
401+
402+
INTEL_UEVENT_CONSTRAINT(0x012a, 0xf),
403+
INTEL_UEVENT_CONSTRAINT(0x012b, 0xf),
400404
INTEL_UEVENT_CONSTRAINT(0x0148, 0x4),
401405
INTEL_UEVENT_CONSTRAINT(0x0175, 0x4),
402406

403407
INTEL_EVENT_CONSTRAINT(0x2e, 0x3ff),
404408
INTEL_EVENT_CONSTRAINT(0x3c, 0x3ff),
405-
/*
406-
* Generally event codes < 0x90 are restricted to counters 0-3.
407-
* The 0x2E and 0x3C are exception, which has no restriction.
408-
*/
409-
INTEL_EVENT_CONSTRAINT_RANGE(0x01, 0x8f, 0xf),
410409

411-
INTEL_UEVENT_CONSTRAINT(0x01a3, 0xf),
412-
INTEL_UEVENT_CONSTRAINT(0x02a3, 0xf),
413410
INTEL_UEVENT_CONSTRAINT(0x08a3, 0x4),
414411
INTEL_UEVENT_CONSTRAINT(0x0ca3, 0x4),
415412
INTEL_UEVENT_CONSTRAINT(0x04a4, 0x1),
416413
INTEL_UEVENT_CONSTRAINT(0x08a4, 0x1),
417414
INTEL_UEVENT_CONSTRAINT(0x10a4, 0x1),
418415
INTEL_UEVENT_CONSTRAINT(0x01b1, 0x8),
416+
INTEL_UEVENT_CONSTRAINT(0x01cd, 0x3fc),
419417
INTEL_UEVENT_CONSTRAINT(0x02cd, 0x3),
420-
INTEL_EVENT_CONSTRAINT(0xce, 0x1),
421418

422419
INTEL_EVENT_CONSTRAINT_RANGE(0xd0, 0xdf, 0xf),
423-
/*
424-
* Generally event codes >= 0x90 are likely to have no restrictions.
425-
* The exception are defined as above.
426-
*/
427-
INTEL_EVENT_CONSTRAINT_RANGE(0x90, 0xfe, 0x3ff),
420+
421+
INTEL_UEVENT_CONSTRAINT(0x00e0, 0xf),
428422

429423
EVENT_CONSTRAINT_END
430424
};

arch/x86/events/intel/ds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ struct event_constraint intel_lnc_pebs_event_constraints[] = {
11991199
INTEL_FLAGS_UEVENT_CONSTRAINT(0x100, 0x100000000ULL), /* INST_RETIRED.PREC_DIST */
12001200
INTEL_FLAGS_UEVENT_CONSTRAINT(0x0400, 0x800000000ULL),
12011201

1202-
INTEL_HYBRID_LDLAT_CONSTRAINT(0x1cd, 0x3ff),
1202+
INTEL_HYBRID_LDLAT_CONSTRAINT(0x1cd, 0x3fc),
12031203
INTEL_HYBRID_STLAT_CONSTRAINT(0x2cd, 0x3),
12041204
INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x11d0, 0xf), /* MEM_INST_RETIRED.STLB_MISS_LOADS */
12051205
INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST(0x12d0, 0xf), /* MEM_INST_RETIRED.STLB_MISS_STORES */

0 commit comments

Comments
 (0)