This is a note to let you know that I've just added the patch titled perf/x86: Fix missing sample size update on AMD BRS to the 6.3-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: perf-x86-fix-missing-sample-size-update-on-amd-brs.patch and it can be found in the queue-6.3 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 90befef5a9e820ccccc33181ec14c015980300cc Mon Sep 17 00:00:00 2001 From: Namhyung Kim <namhyung@xxxxxxxxxx> Date: Wed, 26 Apr 2023 20:05:27 -0700 Subject: perf/x86: Fix missing sample size update on AMD BRS From: Namhyung Kim <namhyung@xxxxxxxxxx> commit 90befef5a9e820ccccc33181ec14c015980300cc upstream. It missed to convert a PERF_SAMPLE_BRANCH_STACK user to call the new perf_sample_save_brstack() helper in order to update the dyn_size. This affects AMD Zen3 machines with the branch-brs event. Fixes: eb55b455ef9c ("perf/core: Add perf_sample_save_brstack() helper") Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Link: https://lkml.kernel.org/r/20230427030527.580841-1-namhyung@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/x86/events/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index d096b04bf80e..9d248703cbdd 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1703,10 +1703,8 @@ int x86_pmu_handle_irq(struct pt_regs *regs) perf_sample_data_init(&data, 0, event->hw.last_period); - if (has_branch_stack(event)) { - data.br_stack = &cpuc->lbr_stack; - data.sample_flags |= PERF_SAMPLE_BRANCH_STACK; - } + if (has_branch_stack(event)) + perf_sample_save_brstack(&data, event, &cpuc->lbr_stack); if (perf_event_overflow(event, &data, regs)) x86_pmu_stop(event, 0); -- 2.40.1 Patches currently in stable-queue which might be from namhyung@xxxxxxxxxx are queue-6.3/perf-script-fix-python-support-when-no-libtraceevent.patch queue-6.3/perf-tracepoint-fix-memory-leak-in-is_valid_tracepoi.patch queue-6.3/perf-cs-etm-fix-timeless-decode-mode-detection.patch queue-6.3/perf-x86-fix-missing-sample-size-update-on-amd-brs.patch queue-6.3/perf-symbols-fix-use-after-free-in-get_plt_got_name.patch queue-6.3/perf-lock-contention-fix-compiler-builtin-detection.patch queue-6.3/perf-map-delete-two-variable-initialisations-before-.patch queue-6.3/perf-build-support-python-perf.so-testing.patch queue-6.3/perf-stat-separate-bperf-from-bpf_profiler.patch queue-6.3/perf-symbols-fix-unaligned-access-in-get_x86_64_plt_.patch queue-6.3/perf-tests-record_offcpu.sh-fix-redirection-of-stder.patch queue-6.3/perf-test-fix-wrong-size-expectation-for-setup-struc.patch queue-6.3/perf-hist-improve-srcfile-sort-key-performance-reall.patch queue-6.3/perf-record-fix-read-lost-count-failed-msg-with-samp.patch queue-6.3/perf-test-fix-pmu-event-table-sanity-for-no_jevents-.patch queue-6.3/perf-ftrace-make-system-wide-the-default-target-for-.patch queue-6.3/perf-symbols-fix-return-incorrect-build_id-size-in-e.patch