FAILED: patch "[PATCH] perf/x86/intel: Remove incorrect LionCove PEBS data-source" failed to apply to 6.18-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.18-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.18.y
git checkout FETCH_HEAD
git cherry-pick -x 7c944595cc43a664019edc22505b6d6f6039be5e
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026092943-cosmetics-enforced-4f4e@gregkh' --subject-prefix 'PATCH 6.18.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7c944595cc43a664019edc22505b6d6f6039be5e Mon Sep 17 00:00:00 2001
From: Dapeng Mi <[email protected]>
Date: Thu, 17 Sep 2026 09:52:27 +0800
Subject: [PATCH] perf/x86/intel: Remove incorrect LionCove PEBS data-source
constraints
On Lion Cove, PEBS data source is valid only for these events:
- MEM_TRANS_RETIRED.LOAD_LATENCY (0x1cd)
- MEM_TRANS_RETIRED.STORE_SAMPLE (0x2cd)
The perfmon database (https://github.com/intel/perfmon) previously tagged additional memory events such as MEM_INST_RETIRED.STLB_MISS_LOADS with L1_Hit_Indication, implying PEBS data-source support, which is incorrect. The database has since been fixed, but intel_lnc_pebs_event_constraints[] still follows the old definition and marks those events as data-source capable.
As a result, get_data_src() may decode data-source information for events that do not provide valid PEBS data-source data and mislead users.
Remove those non-data-source memory events from the Lion Cove PEBS constraint table so matching falls back to the regular non-PEBS constraints, which already provide the same counter constraints.
Also update lnc_latency_data() to decode LOAD/STORE flags explicitly when setting memory operation direction, for consistency with other *_latency_data() helpers.
arch/x86/events/intel/ds.c +5 -17
@@ -577,7 +577,11 @@ static u64 lnc_latency_data(struct perf_event *event, u64 status) val |=P (BLK ,NA ); src.val = val; -if (event->hw.flags &PERF_X86_EVENT_PEBS_ST_HSW ) +if (event->hw.flags & + (PERF_X86_EVENT_PEBS_LDLAT |PERF_X86_EVENT_PEBS_LD_HSW )) + src.mem_op =P (OP ,LOAD ); +if (event->hw.flags & + (PERF_X86_EVENT_PEBS_STLAT |PERF_X86_EVENT_PEBS_ST_HSW )) src.mem_op =P (OP ,STORE );return src.val;
@@ -1510,24 +1514,8 @@ struct event_constraint intel_lnc_pebs_event_constraints[] = {INTEL_FLAGS_UEVENT_CONSTRAINT (0x012a ,0x1 ),/* OCR.* events */ INTEL_FLAGS_UEVENT_CONSTRAINT (0x012b ,0x1 ),/* OCR.* events */ -INTEL_FLAGS_UEVENT_CONSTRAINT (0x04a4 ,0x1 ),/* TOPDOWN.BAD_SPEC_SLOTS */ -INTEL_FLAGS_UEVENT_CONSTRAINT (0x08a4 ,0x1 ),/* TOPDOWN.BR_MISPREDICT_SLOTS */ -INTEL_FLAGS_UEVENT_CONSTRAINT (0x10a4 ,0x8 ),/* TOPDOWN.MEMORY_BOUND_SLOTS */ -INTEL_HYBRID_LDLAT_CONSTRAINT (0x1cd ,0x3fc ), INTEL_HYBRID_STLAT_CONSTRAINT(0x2cd, 0x3), -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x11d0 ,0xf ),/* MEM_INST_RETIRED.STLB_MISS_LOADS */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST (0x12d0 ,0xf ),/* MEM_INST_RETIRED.STLB_MISS_STORES */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x21d0 ,0xf ),/* MEM_INST_RETIRED.LOCK_LOADS */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x41d0 ,0xf ),/* MEM_INST_RETIRED.SPLIT_LOADS */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST (0x42d0 ,0xf ),/* MEM_INST_RETIRED.SPLIT_STORES */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x81d0 ,0xf ),/* MEM_INST_RETIRED.ALL_LOADS */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST (0x82d0 ,0xf ),/* MEM_INST_RETIRED.ALL_STORES */ -INTEL_FLAGS_UEVENT_CONSTRAINT (0x87d0 ,0x3ff ),/* MEM_INST_RETIRED.ANY */ - -INTEL_FLAGS_EVENT_CONSTRAINT_DATALA_LD_RANGE (0xd1 ,0xd4 ,0xf ), - -INTEL_FLAGS_EVENT_CONSTRAINT (0xd0 ,0xf ),/* * Everything else is handled by PMU_FL_PEBS_ALL, because we
Sasha Levin
maintainerPATCH 1/2 perf/x86/intel: Update event constraints and cache_extra_regsfor LNL
From: Dapeng Mi <[email protected]>
[ Upstream commit 331c3e4fa39a87560c09bdd878652090ae040b69 ]
Update perf hard-coded event constraints and cache_extra_regs[] for Lunarlake according to the latest LNL perfmon events (V1.22).
LNL introduces new extra register values for the OCR L3 cache events, so introduce lnc_hw_cache_extra_regs[] and skt_hw_cache_extra_regs[] to reflect the changes.
LNL perfmon events:
https://github.com/intel/perfmon/blob/main/LNL/events/lunarlake_lioncove_core.json
https://github.com/intel/perfmon/blob/main/LNL/events/lunarlake_skymont_core.json
[Backport to 6.18: retain the Lion Cove PEBS constraint additions needed by 7c944595cc43 ("perf/x86/intel: Remove incorrect LionCove PEBS data-source constraints"). Keep the matching regular counter masks for TOPDOWN.MEMORY_BOUND_SLOTS (0x10a4, 0x8) and MEM_INST_RETIRED.ANY (0x87d0, 0x3ff), since that fix removes their PEBS-specific entries and falls back to the regular constraint table.
Omit the unrelated cache extra-register tables and PMU initialization changes, which depend on cache-event refactoring and intel_pmu_init_cmt() absent from 6.18. Also omit the unrelated fixed-counter, non-PEBS OCR, 0x00e0, and Skymont constraint updates. No functions are added.]
Stable-dep-of: 7c944595cc43 ("perf/x86/intel: Remove incorrect LionCove PEBS data-source constraints")
--- arch/x86/events/intel/core.c | 3 ++- arch/x86/events/intel/ds.c | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-)
arch/x86/events/intel/core.c +2 -1
@@ -412,11 +412,12 @@ static struct event_constraint intel_lnc_event_constraints[] = {INTEL_UEVENT_CONSTRAINT (0x0ca3 ,0x4 ),INTEL_UEVENT_CONSTRAINT (0x04a4 ,0x1 ),INTEL_UEVENT_CONSTRAINT (0x08a4 ,0x1 ), -INTEL_UEVENT_CONSTRAINT (0x10a4 ,0x1 ), +INTEL_UEVENT_CONSTRAINT (0x10a4 ,0x8 ),INTEL_UEVENT_CONSTRAINT (0x01b1 ,0x8 ),INTEL_UEVENT_CONSTRAINT (0x01cd ,0x3fc ),INTEL_UEVENT_CONSTRAINT (0x02cd ,0x3 ), +INTEL_UEVENT_CONSTRAINT (0x87d0 ,0x3ff ),INTEL_EVENT_CONSTRAINT_RANGE (0xd0 ,0xdf ,0xf ), INTEL_UEVENT_CONSTRAINT(0x00e0, 0xf),
arch/x86/events/intel/ds.c +8 -0
@@ -1208,6 +1208,13 @@ struct event_constraint intel_lnc_pebs_event_constraints[] = {INTEL_FLAGS_UEVENT_CONSTRAINT (0x100 ,0x100000000ULL ),/* INST_RETIRED.PREC_DIST */ INTEL_FLAGS_UEVENT_CONSTRAINT (0x0400 ,0x800000000ULL ), +INTEL_FLAGS_UEVENT_CONSTRAINT (0x012a ,0x1 ),/* OCR.* events */ +INTEL_FLAGS_UEVENT_CONSTRAINT (0x012b ,0x1 ),/* OCR.* events */ + +INTEL_FLAGS_UEVENT_CONSTRAINT (0x04a4 ,0x1 ),/* TOPDOWN.BAD_SPEC_SLOTS */ +INTEL_FLAGS_UEVENT_CONSTRAINT (0x08a4 ,0x1 ),/* TOPDOWN.BR_MISPREDICT_SLOTS */ +INTEL_FLAGS_UEVENT_CONSTRAINT (0x10a4 ,0x8 ),/* TOPDOWN.MEMORY_BOUND_SLOTS */ +INTEL_HYBRID_LDLAT_CONSTRAINT (0x1cd ,0x3fc ),INTEL_HYBRID_STLAT_CONSTRAINT (0x2cd ,0x3 ), INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD(0x11d0, 0xf), /* MEM_INST_RETIRED.STLB_MISS_LOADS */
@@ -1217,6 +1224,7 @@ struct event_constraint intel_lnc_pebs_event_constraints[] = {INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST (0x42d0 ,0xf ),/* MEM_INST_RETIRED.SPLIT_STORES */ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x81d0 ,0xf ),/* MEM_INST_RETIRED.ALL_LOADS */ INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST (0x82d0 ,0xf ),/* MEM_INST_RETIRED.ALL_STORES */ +INTEL_FLAGS_UEVENT_CONSTRAINT (0x87d0 ,0x3ff ),/* MEM_INST_RETIRED.ANY */ INTEL_FLAGS_EVENT_CONSTRAINT_DATALA_LD_RANGE(0xd1, 0xd4, 0xf),
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 2/2 perf/x86/intel: Remove incorrect LionCove PEBS data-source constraints
From: Dapeng Mi <[email protected]>
[ Upstream commit 7c944595cc43a664019edc22505b6d6f6039be5e ]
On Lion Cove, PEBS data source is valid only for these events:
- MEM_TRANS_RETIRED.LOAD_LATENCY (0x1cd)
- MEM_TRANS_RETIRED.STORE_SAMPLE (0x2cd)
The perfmon database (https://github.com/intel/perfmon) previously tagged additional memory events such as MEM_INST_RETIRED.STLB_MISS_LOADS with L1_Hit_Indication, implying PEBS data-source support, which is incorrect. The database has since been fixed, but intel_lnc_pebs_event_constraints[] still follows the old definition and marks those events as data-source capable.
As a result, get_data_src() may decode data-source information for events that do not provide valid PEBS data-source data and mislead users.
Remove those non-data-source memory events from the Lion Cove PEBS constraint table so matching falls back to the regular non-PEBS constraints, which already provide the same counter constraints.
Also update lnc_latency_data() to decode LOAD/STORE flags explicitly when setting memory operation direction, for consistency with other *_latency_data() helpers.
--- arch/x86/events/intel/ds.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-)
arch/x86/events/intel/ds.c +5 -17
@@ -385,7 +385,11 @@ static u64 lnc_latency_data(struct perf_event *event, u64 status) val |=P (BLK ,NA ); src.val = val; -if (event->hw.flags &PERF_X86_EVENT_PEBS_ST_HSW ) +if (event->hw.flags & + (PERF_X86_EVENT_PEBS_LDLAT |PERF_X86_EVENT_PEBS_LD_HSW )) + src.mem_op =P (OP ,LOAD ); +if (event->hw.flags & + (PERF_X86_EVENT_PEBS_STLAT |PERF_X86_EVENT_PEBS_ST_HSW )) src.mem_op =P (OP ,STORE );return src.val;
@@ -1211,24 +1215,8 @@ struct event_constraint intel_lnc_pebs_event_constraints[] = {INTEL_FLAGS_UEVENT_CONSTRAINT (0x012a ,0x1 ),/* OCR.* events */ INTEL_FLAGS_UEVENT_CONSTRAINT (0x012b ,0x1 ),/* OCR.* events */ -INTEL_FLAGS_UEVENT_CONSTRAINT (0x04a4 ,0x1 ),/* TOPDOWN.BAD_SPEC_SLOTS */ -INTEL_FLAGS_UEVENT_CONSTRAINT (0x08a4 ,0x1 ),/* TOPDOWN.BR_MISPREDICT_SLOTS */ -INTEL_FLAGS_UEVENT_CONSTRAINT (0x10a4 ,0x8 ),/* TOPDOWN.MEMORY_BOUND_SLOTS */ -INTEL_HYBRID_LDLAT_CONSTRAINT (0x1cd ,0x3fc ), INTEL_HYBRID_STLAT_CONSTRAINT(0x2cd, 0x3), -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x11d0 ,0xf ),/* MEM_INST_RETIRED.STLB_MISS_LOADS */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST (0x12d0 ,0xf ),/* MEM_INST_RETIRED.STLB_MISS_STORES */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x21d0 ,0xf ),/* MEM_INST_RETIRED.LOCK_LOADS */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x41d0 ,0xf ),/* MEM_INST_RETIRED.SPLIT_LOADS */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST (0x42d0 ,0xf ),/* MEM_INST_RETIRED.SPLIT_STORES */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_LD (0x81d0 ,0xf ),/* MEM_INST_RETIRED.ALL_LOADS */ -INTEL_FLAGS_UEVENT_CONSTRAINT_DATALA_ST (0x82d0 ,0xf ),/* MEM_INST_RETIRED.ALL_STORES */ -INTEL_FLAGS_UEVENT_CONSTRAINT (0x87d0 ,0x3ff ),/* MEM_INST_RETIRED.ANY */ - -INTEL_FLAGS_EVENT_CONSTRAINT_DATALA_LD_RANGE (0xd1 ,0xd4 ,0xf ), - -INTEL_FLAGS_EVENT_CONSTRAINT (0xd0 ,0xf ),/* * Everything else is handled by PMU_FL_PEBS_ALL, because we
Signature · 1 line
2.53.0