Re: [PATCH] static_call: fix function type mismatch

2021-03-25 Thread Rasmus Villemoes
On 25/03/2021 08.42, Peter Zijlstra wrote: > On Thu, Mar 25, 2021 at 01:42:41AM +0100, Rasmus Villemoes wrote: >>> Actually, it looks like I can't select PREEMPT_DYNAMIC> and tweaking Kconfig >> >> Ah, there's no prompt on the "bool" line, so it doesn't show up. That >> seems to be a mistake,

Re: [PATCH] static_call: fix function type mismatch

2021-03-25 Thread Ard Biesheuvel
On Thu, 25 Mar 2021 at 08:43, Peter Zijlstra wrote: > > On Thu, Mar 25, 2021 at 01:42:41AM +0100, Rasmus Villemoes wrote: > > > Actually, it looks like I can't select PREEMPT_DYNAMIC> and tweaking > > > Kconfig > > > > Ah, there's no prompt on the "bool" line, so it doesn't show up. That > >

Re: [PATCH] static_call: fix function type mismatch

2021-03-25 Thread Peter Zijlstra
On Thu, Mar 25, 2021 at 01:42:41AM +0100, Rasmus Villemoes wrote: > > Actually, it looks like I can't select PREEMPT_DYNAMIC> and tweaking Kconfig > > Ah, there's no prompt on the "bool" line, so it doesn't show up. That > seems to be a mistake, since there's an elaborate help text which says >

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Rasmus Villemoes
On 25/03/2021 00.40, Sami Tolvanen wrote: > On Wed, Mar 24, 2021 at 3:53 PM Rasmus Villemoes > wrote: >> >> On 24/03/2021 23.34, Sami Tolvanen wrote: >>> On Wed, Mar 24, 2021 at 2:51 PM Rasmus Villemoes >>> wrote: On 24/03/2021 18.33, Peter Zijlstra wrote: > On Wed, Mar 24, 2021 at

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Sami Tolvanen
On Wed, Mar 24, 2021 at 3:53 PM Rasmus Villemoes wrote: > > On 24/03/2021 23.34, Sami Tolvanen wrote: > > On Wed, Mar 24, 2021 at 2:51 PM Rasmus Villemoes > > wrote: > >> > >> On 24/03/2021 18.33, Peter Zijlstra wrote: > >>> On Wed, Mar 24, 2021 at 05:45:52PM +0100, Rasmus Villemoes wrote: >

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 23.34, Sami Tolvanen wrote: > On Wed, Mar 24, 2021 at 2:51 PM Rasmus Villemoes > wrote: >> >> On 24/03/2021 18.33, Peter Zijlstra wrote: >>> On Wed, Mar 24, 2021 at 05:45:52PM +0100, Rasmus Villemoes wrote: Sorry, I think I misread the code. The static calls are indeed

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Sami Tolvanen
On Wed, Mar 24, 2021 at 2:51 PM Rasmus Villemoes wrote: > > On 24/03/2021 18.33, Peter Zijlstra wrote: > > On Wed, Mar 24, 2021 at 05:45:52PM +0100, Rasmus Villemoes wrote: > >> Sorry, I think I misread the code. The static calls are indeed > >> initialized with a function with the right

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 18.33, Peter Zijlstra wrote: > On Wed, Mar 24, 2021 at 05:45:52PM +0100, Rasmus Villemoes wrote: >> Sorry, I think I misread the code. The static calls are indeed >> initialized with a function with the right prototype. Try adding >> "preempt=full" on the command line so that we

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Peter Zijlstra
On Wed, Mar 24, 2021 at 06:33:39PM +0100, Peter Zijlstra wrote: > On Wed, Mar 24, 2021 at 05:45:52PM +0100, Rasmus Villemoes wrote: > > Sorry, I think I misread the code. The static calls are indeed > > initialized with a function with the right prototype. Try adding > > "preempt=full" on the

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Peter Zijlstra
On Wed, Mar 24, 2021 at 05:45:52PM +0100, Rasmus Villemoes wrote: > Sorry, I think I misread the code. The static calls are indeed > initialized with a function with the right prototype. Try adding > "preempt=full" on the command line so that we exercise these lines > >

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Rasmus Villemoes
On 24/03/2021 17.01, Sami Tolvanen wrote: > On Wed, Mar 24, 2021 at 5:46 AM Rasmus Villemoes > wrote: >> >> On 23/03/2021 08.47, Peter Zijlstra wrote: >>> On Mon, Mar 22, 2021 at 05:29:21PM -0400, Steven Rostedt wrote: On Mon, 22 Mar 2021 22:18:17 +0100 Arnd Bergmann wrote: >

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Sami Tolvanen
On Wed, Mar 24, 2021 at 5:46 AM Rasmus Villemoes wrote: > > On 23/03/2021 08.47, Peter Zijlstra wrote: > > On Mon, Mar 22, 2021 at 05:29:21PM -0400, Steven Rostedt wrote: > >> On Mon, 22 Mar 2021 22:18:17 +0100 > >> Arnd Bergmann wrote: > >> > >>> I think the code works correctly on all

Re: [PATCH] static_call: fix function type mismatch

2021-03-24 Thread Rasmus Villemoes
On 23/03/2021 08.47, Peter Zijlstra wrote: > On Mon, Mar 22, 2021 at 05:29:21PM -0400, Steven Rostedt wrote: >> On Mon, 22 Mar 2021 22:18:17 +0100 >> Arnd Bergmann wrote: >> >>> I think the code works correctly on all architectures we support because >>> both 'int' and 'long' are returned in a

Re: [PATCH] static_call: fix function type mismatch

2021-03-23 Thread Peter Zijlstra
On Mon, Mar 22, 2021 at 05:29:21PM -0400, Steven Rostedt wrote: > On Mon, 22 Mar 2021 22:18:17 +0100 > Arnd Bergmann wrote: > > > I think the code works correctly on all architectures we support because > > both 'int' and 'long' are returned in a register with any unused bits > > cleared. > >

Re: [PATCH] static_call: fix function type mismatch

2021-03-23 Thread Peter Zijlstra
On Mon, Mar 22, 2021 at 10:18:17PM +0100, Arnd Bergmann wrote: > > Steve is correct. Also, why is that warning correct? On x86 we return in > > RAX, and using int will simply not inspect the upper 32 bits there. > > I think the code works correctly on all architectures we support because > both

Re: [PATCH] static_call: fix function type mismatch

2021-03-22 Thread Steven Rostedt
On Mon, 22 Mar 2021 22:18:17 +0100 Arnd Bergmann wrote: > I think the code works correctly on all architectures we support because > both 'int' and 'long' are returned in a register with any unused bits cleared. > It is however undefined behavior in C because 'int' and 'long' are not >

Re: [PATCH] static_call: fix function type mismatch

2021-03-22 Thread Arnd Bergmann
On Mon, Mar 22, 2021 at 9:47 PM Peter Zijlstra wrote: > On Mon, Mar 22, 2021 at 03:32:14PM -0400, Steven Rostedt wrote: > > On Mon, 22 Mar 2021 18:06:37 +0100 > > Arnd Bergmann wrote: > > > > > From: Arnd Bergmann > > > > > > The __static_call_return0() function is declared to return a 'long',

Re: [PATCH] static_call: fix function type mismatch

2021-03-22 Thread Peter Zijlstra
On Mon, Mar 22, 2021 at 03:32:14PM -0400, Steven Rostedt wrote: > On Mon, 22 Mar 2021 18:06:37 +0100 > Arnd Bergmann wrote: > > > From: Arnd Bergmann > > > > The __static_call_return0() function is declared to return a 'long', > > while it aliases a couple of functions that all return 'int'.

Re: [PATCH] static_call: fix function type mismatch

2021-03-22 Thread Steven Rostedt
On Mon, 22 Mar 2021 18:06:37 +0100 Arnd Bergmann wrote: > From: Arnd Bergmann > > The __static_call_return0() function is declared to return a 'long', > while it aliases a couple of functions that all return 'int'. When > building with 'make W=1', gcc warns about this: > >

[PATCH] static_call: fix function type mismatch

2021-03-22 Thread Arnd Bergmann
From: Arnd Bergmann The __static_call_return0() function is declared to return a 'long', while it aliases a couple of functions that all return 'int'. When building with 'make W=1', gcc warns about this: kernel/sched/core.c:5420:37: error: cast between incompatible function types from 'long