diff --git a/patches.kernel.org/6.3.3-224-perf-x86-Fix-missing-sample-size-update-on-AMD-.patch b/patches.kernel.org/6.3.3-224-perf-x86-Fix-missing-sample-size-update-on-AMD-.patch new file mode 100644 index 0000000..3ad88da --- /dev/null +++ b/patches.kernel.org/6.3.3-224-perf-x86-Fix-missing-sample-size-update-on-AMD-.patch @@ -0,0 +1,44 @@ +From: Namhyung Kim +Date: Wed, 26 Apr 2023 20:05:27 -0700 +Subject: [PATCH] perf/x86: Fix missing sample size update on AMD BRS +References: bsc#1012628 +Patch-mainline: 6.3.3 +Git-commit: 90befef5a9e820ccccc33181ec14c015980300cc + +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 +Signed-off-by: Peter Zijlstra (Intel) +Cc: stable@vger.kernel.org +Link: https://lkml.kernel.org/r/20230427030527.580841-1-namhyung@kernel.org +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Jiri Slaby +--- + 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 d096b04b..9d248703 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.35.3 + diff --git a/series.conf b/series.conf index 99773a2..49790f6 100644 --- a/series.conf +++ b/series.conf @@ -957,6 +957,7 @@ patches.kernel.org/6.3.3-221-drm-amd-display-Update-minimum-stutter-residenc.patch patches.kernel.org/6.3.3-222-drm-amd-display-Lowering-min-Z8-residency-time.patch patches.kernel.org/6.3.3-223-parisc-Fix-encoding-of-swp_entry-due-to-added-S.patch + patches.kernel.org/6.3.3-224-perf-x86-Fix-missing-sample-size-update-on-AMD-.patch ######################################################## # Build fixes that apply to the vanilla kernel too.