Re: [RFC PATCH 1/7] static_call/x86: Add __static_call_returnl0()

2020-11-10 Thread Peter Zijlstra
On Tue, Nov 10, 2020 at 02:42:23PM +0100, Frederic Weisbecker wrote: > On Tue, Nov 10, 2020 at 11:13:07AM +0100, Peter Zijlstra wrote: > > On Tue, Nov 10, 2020 at 10:55:15AM +0100, Peter Zijlstra wrote: > > > On Tue, Nov 10, 2020 at 01:56:03AM +0100, Frederic Weisbecker wrote: > > > > > > >

Re: [RFC PATCH 1/7] static_call/x86: Add __static_call_returnl0()

2020-11-10 Thread Frederic Weisbecker
On Tue, Nov 10, 2020 at 11:13:07AM +0100, Peter Zijlstra wrote: > On Tue, Nov 10, 2020 at 10:55:15AM +0100, Peter Zijlstra wrote: > > On Tue, Nov 10, 2020 at 01:56:03AM +0100, Frederic Weisbecker wrote: > > > > > [fweisbec: s/disp16/data16, integrate into text_get_insn(), elaborate > > > comment

Re: [RFC PATCH 1/7] static_call/x86: Add __static_call_returnl0()

2020-11-10 Thread Frederic Weisbecker
On Tue, Nov 10, 2020 at 10:55:15AM +0100, Peter Zijlstra wrote: > On Tue, Nov 10, 2020 at 01:56:03AM +0100, Frederic Weisbecker wrote: > > diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c > > index 2400ad62f330..37592f576a10 100644 > > --- a/arch/x86/kernel/alternative.c

Re: [RFC PATCH 1/7] static_call/x86: Add __static_call_returnl0()

2020-11-10 Thread Peter Zijlstra
On Tue, Nov 10, 2020 at 10:55:15AM +0100, Peter Zijlstra wrote: > On Tue, Nov 10, 2020 at 01:56:03AM +0100, Frederic Weisbecker wrote: > > > [fweisbec: s/disp16/data16, integrate into text_get_insn(), elaborate > > comment on the resulting insn, emulate on int3 trap, provide validation, > >

Re: [RFC PATCH 1/7] static_call/x86: Add __static_call_returnl0()

2020-11-10 Thread Peter Zijlstra
On Tue, Nov 10, 2020 at 01:56:03AM +0100, Frederic Weisbecker wrote: > diff --git a/include/linux/static_call.h b/include/linux/static_call.h > index 695da4c9b338..055544793430 100644 > --- a/include/linux/static_call.h > +++ b/include/linux/static_call.h > @@ -136,6 +136,9 @@ extern void

Re: [RFC PATCH 1/7] static_call/x86: Add __static_call_returnl0()

2020-11-10 Thread Peter Zijlstra
On Tue, Nov 10, 2020 at 01:56:03AM +0100, Frederic Weisbecker wrote: > [fweisbec: s/disp16/data16, integrate into text_get_insn(), elaborate > comment on the resulting insn, emulate on int3 trap, provide validation, > uninline __static_call_return0() for HAVE_STATIC_CALL] > diff --git

[RFC PATCH 1/7] static_call/x86: Add __static_call_returnl0()

2020-11-09 Thread Frederic Weisbecker
From: Peter Zijlstra Provide a stub function that return 0 and wire up the static call site patching to replace the CALL with a single 5 byte instruction that clears %RAX, the return value register. The function can be cast to any function pointer type that has a single %RAX return (including