summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2023-04-26 20:05:27 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-17 14:02:05 +0200
commit34b7f8a42333d443378fd9b8c7537e47c73d5e59 (patch)
treed7b1eac41919b51b9f815316b2afa2d087015261
parentc97d51f160c428687150a181e7a2dd82bf3d706e (diff)
downloadlinux-stable-34b7f8a42333d443378fd9b8c7537e47c73d5e59.tar.gz
linux-stable-34b7f8a42333d443378fd9b8c7537e47c73d5e59.tar.bz2
linux-stable-34b7f8a42333d443378fd9b8c7537e47c73d5e59.zip
perf/x86: Fix missing sample size update on AMD BRS
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@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20230427030527.580841-1-namhyung@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/x86/events/core.c6
1 files 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);