public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf/x86/intel: Fix OMR snoop information parsing issues
@ 2026-03-11  7:52 Dapeng Mi
  2026-03-11  7:52 ` [PATCH 2/2] perf/x86: Update cap_user_rdpmc base on rdpmc user disable state Dapeng Mi
  2026-03-12  4:07 ` [PATCH 1/2] perf/x86/intel: Fix OMR snoop information parsing issues Ian Rogers
  0 siblings, 2 replies; 18+ messages in thread
From: Dapeng Mi @ 2026-03-11  7:52 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Ian Rogers, Adrian Hunter, Alexander Shishkin,
	Andi Kleen, Eranian Stephane
  Cc: linux-kernel, linux-perf-users, Dapeng Mi, Zide Chen,
	Falcon Thomas, Xudong Hao, Dapeng Mi

When omr_source is 0x2, the omr_snoop (bit[6]) and omr_promoted (bit[7])
fields are combined to represent the snoop information. However, the
omr_promoted field was not left-shifted by 1 bit, resulting in incorrect
snoop information.

Besides, the snoop information parsing is not accurate for some OMR
sources, like the snoop information should be SNOOP_NONE for these memory
access (omr_source >= 7) instead of SNOOP_HIT.

Fix these issues.

Reported-by: Ian Rogers <irogers@google.com>
Closes: https://lore.kernel.org/all/CAP-5=fW4zLWFw1v38zCzB9-cseNSTTCtup=p2SDxZq7dPayVww@mail.gmail.com/
Fixes: d2bdcde9626c ("perf/x86/intel: Add support for PEBS memory auxiliary info field in DMR")
Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
---
 arch/x86/events/intel/ds.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
index 5027afc97b65..7f0d515c07c5 100644
--- a/arch/x86/events/intel/ds.c
+++ b/arch/x86/events/intel/ds.c
@@ -345,12 +345,12 @@ static u64 parse_omr_data_source(u8 dse)
 	if (omr.omr_remote)
 		val |= REM;
 
-	val |= omr.omr_hitm ? P(SNOOP, HITM) : P(SNOOP, HIT);
-
 	if (omr.omr_source == 0x2) {
-		u8 snoop = omr.omr_snoop | omr.omr_promoted;
+		u8 snoop = omr.omr_snoop | (omr.omr_promoted << 1);
 
-		if (snoop == 0x0)
+		if (omr.omr_hitm)
+			val |= P(SNOOP, HITM);
+		else if (snoop == 0x0)
 			val |= P(SNOOP, NA);
 		else if (snoop == 0x1)
 			val |= P(SNOOP, MISS);
@@ -359,7 +359,10 @@ static u64 parse_omr_data_source(u8 dse)
 		else if (snoop == 0x3)
 			val |= P(SNOOP, NONE);
 	} else if (omr.omr_source > 0x2 && omr.omr_source < 0x7) {
+		val |= omr.omr_hitm ? P(SNOOP, HITM) : P(SNOOP, HIT);
 		val |= omr.omr_snoop ? P(SNOOPX, FWD) : 0;
+	} else {
+		val |= P(SNOOP, NONE);
 	}
 
 	return val;

base-commit: 73cee0aad1ee2479fde2c9b753a1b66acb7d1b9a
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-03-13  0:48 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11  7:52 [PATCH 1/2] perf/x86/intel: Fix OMR snoop information parsing issues Dapeng Mi
2026-03-11  7:52 ` [PATCH 2/2] perf/x86: Update cap_user_rdpmc base on rdpmc user disable state Dapeng Mi
2026-03-12  4:44   ` Ian Rogers
2026-03-12  5:04     ` Ian Rogers
2026-03-12  5:48       ` [PATCH v1 1/2] perf/x86: Avoid inadvertent casts to x86_hybrid_pmu Ian Rogers
2026-03-12  5:48         ` [PATCH v1 2/2] perf/x86: Reduce is_hybrid calls and aid ellision of BUG_ON in hybrid_pmu Ian Rogers
2026-03-12  6:44           ` Mi, Dapeng
2026-03-12  8:40           ` Peter Zijlstra
2026-03-12 15:06             ` Ian Rogers
2026-03-12  6:43         ` [PATCH v1 1/2] perf/x86: Avoid inadvertent casts to x86_hybrid_pmu Mi, Dapeng
2026-03-12  8:25         ` Mi, Dapeng
2026-03-12  8:31         ` Peter Zijlstra
2026-03-12  9:44           ` Mi, Dapeng
2026-03-12 15:16             ` Ian Rogers
2026-03-13  0:48               ` Mi, Dapeng
2026-03-12  6:23       ` [PATCH 2/2] perf/x86: Update cap_user_rdpmc base on rdpmc user disable state Mi, Dapeng
2026-03-12  6:17     ` Mi, Dapeng
2026-03-12  4:07 ` [PATCH 1/2] perf/x86/intel: Fix OMR snoop information parsing issues Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox