]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
perf/x86/intel: Apply static call for drain_pebs
authorPeter Zijlstra (Intel) <peterz@infradead.org>
Tue, 21 Jan 2025 15:23:00 +0000 (07:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:37:42 +0000 (14:37 +0200)
commit 314dfe10576912e1d786b13c5d4eee8c51b63caa upstream.

The x86_pmu_drain_pebs static call was introduced in commit 7c9903c9bf71
("x86/perf, static_call: Optimize x86_pmu methods"), but it's not really
used to replace the old method.

Apply the static call for drain_pebs.

Fixes: 7c9903c9bf71 ("x86/perf, static_call: Optimize x86_pmu methods")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20250121152303.3128733-1-kan.liang@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/events/intel/core.c
arch/x86/events/intel/ds.c
arch/x86/events/perf_event.h

index b163817ad6daff9269498ca1f0b97daa6307e34b..1fcc8fd50083c6c6d5dd7fe1e15b9184deb0d73d 100644 (file)
@@ -3006,7 +3006,7 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status)
 
                handled++;
                x86_pmu_handle_guest_pebs(regs, &data);
-               x86_pmu.drain_pebs(regs, &data);
+               static_call(x86_pmu_drain_pebs)(regs, &data);
                status &= intel_ctrl | GLOBAL_STATUS_TRACE_TOPAPMI;
 
                /*
index d9a51b638931c6e51932049cf5e04460d0ec3542..7bba8630065db9f4b6047d714fb56f8840092da0 100644 (file)
@@ -847,7 +847,7 @@ static inline void intel_pmu_drain_pebs_buffer(void)
 {
        struct perf_sample_data data;
 
-       x86_pmu.drain_pebs(NULL, &data);
+       static_call(x86_pmu_drain_pebs)(NULL, &data);
 }
 
 /*
index c8ba2be7585d4490af31bad6f31891f224900f2f..ff646c5d4642ef2816b45c926c92d40c5eab6526 100644 (file)
@@ -1052,6 +1052,7 @@ extern struct x86_pmu x86_pmu __read_mostly;
 
 DECLARE_STATIC_CALL(x86_pmu_set_period, *x86_pmu.set_period);
 DECLARE_STATIC_CALL(x86_pmu_update,     *x86_pmu.update);
+DECLARE_STATIC_CALL(x86_pmu_drain_pebs,        *x86_pmu.drain_pebs);
 
 static __always_inline struct x86_perf_task_context_opt *task_context_opt(void *ctx)
 {