Skip to content

Commit e7fcc54

Browse files
Dapeng MiPeter Zijlstra
authored andcommitted
perf/x86/intel: Fix OMR snoop information parsing issues
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. Closes: https://lore.kernel.org/all/CAP-5=fW4zLWFw1v38zCzB9-cseNSTTCtup=p2SDxZq7dPayVww@mail.gmail.com/ Fixes: d2bdcde ("perf/x86/intel: Add support for PEBS memory auxiliary info field in DMR") Reported-by: Ian Rogers <irogers@google.com> Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Ian Rogers <irogers@google.com> Link: https://patch.msgid.link/20260311075201.2951073-1-dapeng1.mi@linux.intel.com
1 parent 1d07bbd commit e7fcc54

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • arch/x86/events/intel

arch/x86/events/intel/ds.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,12 @@ static u64 parse_omr_data_source(u8 dse)
345345
if (omr.omr_remote)
346346
val |= REM;
347347

348-
val |= omr.omr_hitm ? P(SNOOP, HITM) : P(SNOOP, HIT);
349-
350348
if (omr.omr_source == 0x2) {
351-
u8 snoop = omr.omr_snoop | omr.omr_promoted;
349+
u8 snoop = omr.omr_snoop | (omr.omr_promoted << 1);
352350

353-
if (snoop == 0x0)
351+
if (omr.omr_hitm)
352+
val |= P(SNOOP, HITM);
353+
else if (snoop == 0x0)
354354
val |= P(SNOOP, NA);
355355
else if (snoop == 0x1)
356356
val |= P(SNOOP, MISS);
@@ -359,7 +359,10 @@ static u64 parse_omr_data_source(u8 dse)
359359
else if (snoop == 0x3)
360360
val |= P(SNOOP, NONE);
361361
} else if (omr.omr_source > 0x2 && omr.omr_source < 0x7) {
362+
val |= omr.omr_hitm ? P(SNOOP, HITM) : P(SNOOP, HIT);
362363
val |= omr.omr_snoop ? P(SNOOPX, FWD) : 0;
364+
} else {
365+
val |= P(SNOOP, NONE);
363366
}
364367

365368
return val;

0 commit comments

Comments
 (0)