Skip to content

perf/x86: Fix races when loading guest mediated PMU context

Yosry Ahmed kvm linux-perf-users lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2perf/x86: Prevent races between NMIs and switching LVTPCarch/x86/events/core.c+12 -14 replies
2/2KVM: x86/pmu: Clear PERF_GLOBAL_CTRL after switching to guest LVTPCarch/x86/kvm/pmu.c+6 -212 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] perf/x86: Fix races when loading guest mediated PMU context

Fix a couple of race conditions that can happen while loading the guest mediated PMU context, resulting in either clobbered PMI handling or leaking host events into guest counters.

The series is based on tip/perf/urgent.

An LLM was used to reproduce both issues (using kprobe + BPF to force races), and verify the fixes.

Yosry Ahmed (2):
perf/x86: Prevent races between NMIs and switching LVTPC
KVM: x86/pmu: Clear PERF_GLOBAL_CTRL after switching to guest LVTPC

 arch/x86/events/core.c | 13 ++++++++++++-
 arch/x86/kvm/pmu.c     |  8 ++++++--
 2 files changed, 18 insertions(+), 3 deletions(-)

base-commit: 67b34211a9eb103aba474bc179fab3dd2912f07e

Signature · 1 line
2.56.1.839.g22a8290db9-goog