Skip to content

perf/x86: Limit branch snapshots to valid entries

Sandipan Das bpf linux-perf-users lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 4 repliesIn review
  2. v11 patch 6 repliesSuperseded

Changes in v2 from the cover letter

* Include a fix for Intel LBR.
* Add Tested-by from Dapeng to the Intel fix.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2perf/x86/amd/lbr: Limit branch snapshots to valid entriesarch/x86/events/amd/core.c arch/x86/events/amd/lbr.c+4 -21 reply
2/2perf/x86/intel/lbr: Limit branch snapshots to valid entriesarch/x86/events/intel/core.c arch/x86/events/intel/lbr.c+4 -23 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchDapeng Mi
1/2R-b
2/2T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] perf/x86: Limit branch snapshots to valid entries

Sashiko reported that the vendor-specific branch snapshot callbacks used by bpf_get_branch_snapshot() copy up to x86_pmu.lbr_nr entries from cpuc->lbr_entries[], regardless of how many valid entries the last LBR read produced. This makes BPF programs read stale or invalid branch records. Patch 1 addresses AMD and patch 2 addresses Intel.

Previous version(s) can be found at
v1: https://lore.kernel.org/all/[email protected]/

Changes in v2:
* Include a fix for Intel LBR.
* Add Tested-by from Dapeng to the Intel fix.

    https://lore.kernel.org/all/[email protected]/

Sandipan Das (2):
perf/x86/amd/lbr: Limit branch snapshots to valid entries perf/x86/intel/lbr: Limit branch snapshots to valid entries

 arch/x86/events/amd/core.c   | 2 +-
 arch/x86/events/amd/lbr.c    | 4 +++-
 arch/x86/events/intel/core.c | 2 +-
 arch/x86/events/intel/lbr.c  | 4 +++-
 4 files changed, 8 insertions(+), 4 deletions(-)
Signature · 1 line
2.53.0