Skip to content

Commit f42be33

Browse files
Peter Zijlstragregkh
authored andcommitted
perf/x86: Avoid exposing wrong/stale data in intel_pmu_lbr_read_32()
commit f2200ac311302fcdca6556fd0c5127eab6c65a3e 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) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Fixes: 135c561 ("perf/x86/intel: Support Haswell/v4 LBR format") Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a5e2f80 commit f42be33

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/x86/kernel/cpu/perf_event_intel_lbr.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,9 @@ static void intel_pmu_lbr_read_32(struct cpu_hw_events *cpuc)
410410
cpuc->lbr_entries[i].to = msr_lastbranch.to;
411411
cpuc->lbr_entries[i].mispred = 0;
412412
cpuc->lbr_entries[i].predicted = 0;
413+
cpuc->lbr_entries[i].in_tx = 0;
414+
cpuc->lbr_entries[i].abort = 0;
415+
cpuc->lbr_entries[i].cycles = 0;
413416
cpuc->lbr_entries[i].reserved = 0;
414417
}
415418
cpuc->lbr_stack.nr = i;

0 commit comments

Comments
 (0)