* [PATCH] perf: Fix function pointer case
@ 2023-08-02 11:40 Cixi Geng
2023-08-02 11:47 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Cixi Geng @ 2023-08-02 11:40 UTC (permalink / raw)
To: peterz, gregkh; +Cc: stable, enlin.mu
From: Peter Zijlstra <peterz@infradead.org>
commit 1af6239d1d3e61d33fd2f0ba53d3d1a67cc50574 upstream.
With the advent of CFI it is no longer acceptible to cast function
pointers.
The robot complains thusly:
kernel-events-core.c:warning:cast-from-int-(-)(struct-perf_cpu_pmu_context-)-to-remote_function_f-(aka-int-(-)(void-)-)-converts-to-incompatible-function-type
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Cixi Geng <cixi.geng1@unisoc.com>
---
kernel/events/core.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 97052b2dff7e..c7f13da672c9 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1224,6 +1224,11 @@ static int perf_mux_hrtimer_restart(struct perf_cpu_context *cpuctx)
return 0;
}
+static int perf_mux_hrtimer_restart_ipi(void *arg)
+{
+ return perf_mux_hrtimer_restart(arg);
+}
+
void perf_pmu_disable(struct pmu *pmu)
{
int *count = this_cpu_ptr(pmu->pmu_disable_count);
@@ -11137,8 +11142,7 @@ perf_event_mux_interval_ms_store(struct device *dev,
cpuctx = per_cpu_ptr(pmu->pmu_cpu_context, cpu);
cpuctx->hrtimer_interval = ns_to_ktime(NSEC_PER_MSEC * timer);
- cpu_function_call(cpu,
- (remote_function_f)perf_mux_hrtimer_restart, cpuctx);
+ cpu_function_call(cpu, perf_mux_hrtimer_restart_ipi, cpuctx);
}
cpus_read_unlock();
mutex_unlock(&mux_interval_mutex);
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] perf: Fix function pointer case
2023-08-02 11:40 [PATCH] perf: Fix function pointer case Cixi Geng
@ 2023-08-02 11:47 ` Greg KH
2023-08-03 1:28 ` cixi.geng
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2023-08-02 11:47 UTC (permalink / raw)
To: Cixi Geng; +Cc: peterz, stable, enlin.mu
On Wed, Aug 02, 2023 at 07:40:53PM +0800, Cixi Geng wrote:
> From: Peter Zijlstra <peterz@infradead.org>
>
> commit 1af6239d1d3e61d33fd2f0ba53d3d1a67cc50574 upstream.
> With the advent of CFI it is no longer acceptible to cast function
> pointers.
>
> The robot complains thusly:
>
> kernel-events-core.c:warning:cast-from-int-(-)(struct-perf_cpu_pmu_context-)-to-remote_function_f-(aka-int-(-)(void-)-)-converts-to-incompatible-function-type
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Cixi Geng <cixi.geng1@unisoc.com>
> ---
> kernel/events/core.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
What stable tree(s) is this for?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf: Fix function pointer case
2023-08-02 11:47 ` Greg KH
@ 2023-08-03 1:28 ` cixi.geng
2023-08-04 10:42 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: cixi.geng @ 2023-08-03 1:28 UTC (permalink / raw)
To: Greg KH; +Cc: peterz, stable, enlin.mu
2023年8月2日 19:47, "Greg KH" <gregkh@linuxfoundation.org> 写到:
>
> On Wed, Aug 02, 2023 at 07:40:53PM +0800, Cixi Geng wrote:
>
> >
> > From: Peter Zijlstra <peterz@infradead.org>
> >
> > commit 1af6239d1d3e61d33fd2f0ba53d3d1a67cc50574 upstream.
> > With the advent of CFI it is no longer acceptible to cast function
> > pointers.
> >
> > The robot complains thusly:
> >
> > kernel-events-core.c:warning:cast-from-int-(-)(struct-perf_cpu_pmu_context-)-to-remote_function_f-(aka-int-(-)(void-)-)-converts-to-incompatible-function-type
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > Signed-off-by: Cixi Geng <cixi.geng1@unisoc.com>
> > ---
> > kernel/events/core.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> >
>
> What stable tree(s) is this for?
>
Hi Greg
I want to apply this patch for linux-5.15-y and linux-6.1-y,
the other stable trees not requred for me, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf: Fix function pointer case
2023-08-03 1:28 ` cixi.geng
@ 2023-08-04 10:42 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2023-08-04 10:42 UTC (permalink / raw)
To: cixi.geng; +Cc: peterz, stable, enlin.mu
On Thu, Aug 03, 2023 at 01:28:32AM +0000, cixi.geng@linux.dev wrote:
> 2023年8月2日 19:47, "Greg KH" <gregkh@linuxfoundation.org> 写到:
>
>
> >
> > On Wed, Aug 02, 2023 at 07:40:53PM +0800, Cixi Geng wrote:
> >
> > >
> > > From: Peter Zijlstra <peterz@infradead.org>
> > >
> > > commit 1af6239d1d3e61d33fd2f0ba53d3d1a67cc50574 upstream.
> > > With the advent of CFI it is no longer acceptible to cast function
> > > pointers.
> > >
> > > The robot complains thusly:
> > >
> > > kernel-events-core.c:warning:cast-from-int-(-)(struct-perf_cpu_pmu_context-)-to-remote_function_f-(aka-int-(-)(void-)-)-converts-to-incompatible-function-type
> > >
> > > Reported-by: kernel test robot <lkp@intel.com>
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > Signed-off-by: Cixi Geng <cixi.geng1@unisoc.com>
> > > ---
> > > kernel/events/core.c | 8 ++++++--
> > > 1 file changed, 6 insertions(+), 2 deletions(-)
> > >
> >
> > What stable tree(s) is this for?
> >
> Hi Greg
> I want to apply this patch for linux-5.15-y and linux-6.1-y,
> the other stable trees not requred for me, thanks!
Now queued up, thanks.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-04 10:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02 11:40 [PATCH] perf: Fix function pointer case Cixi Geng
2023-08-02 11:47 ` Greg KH
2023-08-03 1:28 ` cixi.geng
2023-08-04 10:42 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.