lkml.org 
[lkml]   [2020]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/7] static_call/x86: Add __static_call_returnl0()
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
> > +++ b/arch/x86/kernel/alternative.c
> > @@ -1125,6 +1125,10 @@ noinstr int poke_int3_handler(struct pt_regs *regs)
> > int3_emulate_jmp(regs, (long)ip + tp->rel32);
> > break;
> >
> > + case XOR5RAX_INSN_OPCODE:
> > + int3_emulate_xor5rax(regs);
> > + break;
> > +
> > default:
> > BUG();
> > }
> > @@ -1291,6 +1295,7 @@ static void text_poke_loc_init(struct text_poke_loc *tp, void *addr,
> > switch (tp->opcode) {
> > case INT3_INSN_OPCODE:
> > case RET_INSN_OPCODE:
> > + case XOR5RAX_INSN_OPCODE:
> > break;
> >
> > case CALL_INSN_OPCODE:
>
> Why did you add full emulation of this? The patch I send to you used the
> text_poke_bp(.emulate) argument to have it emulate an actual call to the
> out-of-line version of that function.
>
> That should work fine and is a lot less code.

Perhaps I pushed the cleanup a bit too far indeed. I wanted to standardize
it just like any flavour of text patching. And also I thought that emulate
thing was on the way to be deprecated.

Anyway, I'll restore the old version.

Thanks.

\
 
 \ /
  Last update: 2020-11-10 14:25    [W:1.739 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site