Skip to content

Commit 547cc9b

Browse files
committed
Merge tag 'perf_urgent_for_v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Borislav Petkov: - Drop the __weak attribute from a function prototype as it otherwise leads to the function getting replaced by a dummy stub - Fix the umask value setup of the frontend event as former is different on two Intel cores * tag 'perf_urgent_for_v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel: Fix the FRONTEND encoding on GNR and MTL perf/core: Drop __weak attribute from arch_perf_update_userpage() prototype
2 parents 300edd7 + a6742cb commit 547cc9b

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

arch/x86/events/intel/core.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,16 @@ static struct event_constraint intel_spr_event_constraints[] = {
349349
EVENT_CONSTRAINT_END
350350
};
351351

352+
static struct extra_reg intel_gnr_extra_regs[] __read_mostly = {
353+
INTEL_UEVENT_EXTRA_REG(0x012a, MSR_OFFCORE_RSP_0, 0x3fffffffffull, RSP_0),
354+
INTEL_UEVENT_EXTRA_REG(0x012b, MSR_OFFCORE_RSP_1, 0x3fffffffffull, RSP_1),
355+
INTEL_UEVENT_PEBS_LDLAT_EXTRA_REG(0x01cd),
356+
INTEL_UEVENT_EXTRA_REG(0x02c6, MSR_PEBS_FRONTEND, 0x9, FE),
357+
INTEL_UEVENT_EXTRA_REG(0x03c6, MSR_PEBS_FRONTEND, 0x7fff1f, FE),
358+
INTEL_UEVENT_EXTRA_REG(0x40ad, MSR_PEBS_FRONTEND, 0x7, FE),
359+
INTEL_UEVENT_EXTRA_REG(0x04c2, MSR_PEBS_FRONTEND, 0x8, FE),
360+
EVENT_EXTRA_END
361+
};
352362

353363
EVENT_ATTR_STR(mem-loads, mem_ld_nhm, "event=0x0b,umask=0x10,ldlat=3");
354364
EVENT_ATTR_STR(mem-loads, mem_ld_snb, "event=0xcd,umask=0x1,ldlat=3");
@@ -6496,6 +6506,7 @@ __init int intel_pmu_init(void)
64966506
case INTEL_FAM6_SAPPHIRERAPIDS_X:
64976507
case INTEL_FAM6_EMERALDRAPIDS_X:
64986508
x86_pmu.flags |= PMU_FL_MEM_LOADS_AUX;
6509+
x86_pmu.extra_regs = intel_spr_extra_regs;
64996510
fallthrough;
65006511
case INTEL_FAM6_GRANITERAPIDS_X:
65016512
case INTEL_FAM6_GRANITERAPIDS_D:
@@ -6506,7 +6517,8 @@ __init int intel_pmu_init(void)
65066517

65076518
x86_pmu.event_constraints = intel_spr_event_constraints;
65086519
x86_pmu.pebs_constraints = intel_spr_pebs_event_constraints;
6509-
x86_pmu.extra_regs = intel_spr_extra_regs;
6520+
if (!x86_pmu.extra_regs)
6521+
x86_pmu.extra_regs = intel_gnr_extra_regs;
65106522
x86_pmu.limit_period = spr_limit_period;
65116523
x86_pmu.pebs_ept = 1;
65126524
x86_pmu.pebs_aliases = NULL;
@@ -6650,6 +6662,7 @@ __init int intel_pmu_init(void)
66506662
pmu->pebs_constraints = intel_grt_pebs_event_constraints;
66516663
pmu->extra_regs = intel_grt_extra_regs;
66526664
if (is_mtl(boot_cpu_data.x86_model)) {
6665+
x86_pmu.hybrid_pmu[X86_HYBRID_PMU_CORE_IDX].extra_regs = intel_gnr_extra_regs;
66536666
x86_pmu.pebs_latency_data = mtl_latency_data_small;
66546667
extra_attr = boot_cpu_has(X86_FEATURE_RTM) ?
66556668
mtl_hybrid_extra_attr_rtm : mtl_hybrid_extra_attr;

include/linux/perf_event.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,9 +1845,9 @@ int perf_event_exit_cpu(unsigned int cpu);
18451845
#define perf_event_exit_cpu NULL
18461846
#endif
18471847

1848-
extern void __weak arch_perf_update_userpage(struct perf_event *event,
1849-
struct perf_event_mmap_page *userpg,
1850-
u64 now);
1848+
extern void arch_perf_update_userpage(struct perf_event *event,
1849+
struct perf_event_mmap_page *userpg,
1850+
u64 now);
18511851

18521852
#ifdef CONFIG_MMU
18531853
extern __weak u64 arch_perf_get_page_size(struct mm_struct *mm, unsigned long addr);

0 commit comments

Comments
 (0)