Skip to content

Commit b463a3c

Browse files
committed
Merge tag 'perf-urgent-2024-03-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 perf event fixes from Ingo Molnar: - Work around AMD erratum to filter out bogus LBR stack entries - Fix incorrect PMU reset that can result in warnings (or worse) during suspend/hibernation * tag 'perf-urgent-2024-03-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/amd/core: Avoid register reset when CPU is dead perf/x86/amd/lbr: Discard erroneous branch entries
2 parents 032e22f + ad8c912 commit b463a3c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

arch/x86/events/amd/core.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,6 @@ static void amd_pmu_cpu_dead(int cpu)
604604

605605
kfree(cpuhw->lbr_sel);
606606
cpuhw->lbr_sel = NULL;
607-
amd_pmu_cpu_reset(cpu);
608607

609608
if (!x86_pmu.amd_nb_constraints)
610609
return;

arch/x86/events/amd/lbr.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ void amd_pmu_lbr_read(void)
173173

174174
/*
175175
* Check if a branch has been logged; if valid = 0, spec = 0
176-
* then no branch was recorded
176+
* then no branch was recorded; if reserved = 1 then an
177+
* erroneous branch was recorded (see Erratum 1452)
177178
*/
178-
if (!entry.to.split.valid && !entry.to.split.spec)
179+
if ((!entry.to.split.valid && !entry.to.split.spec) ||
180+
entry.to.split.reserved)
179181
continue;
180182

181183
perf_clear_branch_entry_bitfields(br + out);

0 commit comments

Comments
 (0)