Skip to content

Commit 4ff9e6c

Browse files
Peter Zijlstragregkh
Peter Zijlstra
authored andcommitted
perf/x86: Avoid exposing wrong/stale data in intel_pmu_lbr_read_32()
commit f2200ac upstream. When the perf_branch_entry::{in_tx,abort,cycles} fields were added, intel_pmu_lbr_read_32() wasn't updated to initialize them. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Fixes: 135c561 ("perf/x86/intel: Support Haswell/v4 LBR format") Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 535adf2 commit 4ff9e6c

File tree

1 file changed

+3
-0
lines changed
  • arch/x86/events/intel

1 file changed

+3
-0
lines changed

arch/x86/events/intel/lbr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,9 @@ static void intel_pmu_lbr_read_32(struct cpu_hw_events *cpuc)
507507
cpuc->lbr_entries[i].to = msr_lastbranch.to;
508508
cpuc->lbr_entries[i].mispred = 0;
509509
cpuc->lbr_entries[i].predicted = 0;
510+
cpuc->lbr_entries[i].in_tx = 0;
511+
cpuc->lbr_entries[i].abort = 0;
512+
cpuc->lbr_entries[i].cycles = 0;
510513
cpuc->lbr_entries[i].reserved = 0;
511514
}
512515
cpuc->lbr_stack.nr = i;

0 commit comments

Comments
 (0)