lkml.org 
[lkml]   [2018]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v2 4/4] x86/static_call: Add inline static call implementation for x86-64
    On Thu, Nov 29, 2018 at 12:24 PM Josh Poimboeuf <jpoimboe@redhat.com> wrote:
    >
    > > Alternatively, we could actually emulate call instructions like this:
    > >
    > > void __noreturn jump_to_kernel_pt_regs(struct pt_regs *regs, ...)
    > > {
    > > struct pt_regs ptregs_copy = *regs;
    > > barrier();
    > > *(unsigned long *)(regs->sp - 8) = whatever; /* may clobber old
    > > regs, but so what? */
    > > asm volatile ("jmp return_to_alternate_ptregs");
    > > }
    > >
    > > where return_to_alternate_ptregs points rsp to the ptregs and goes
    > > through the normal return path. It's ugly, but we could have a test
    > > case for it, and it should work fine.
    >
    > Is that really any better than my patch to create a gap in the stack
    > (modified for kernel space #BP only)?
    >

    I tend to prefer a nice local hack like mine over a hack that further
    complicates the entry in general. This is not to say I'm thrilled by
    my idea either.

    \
     
     \ /
      Last update: 2018-11-30 17:43    [W:3.621 / U:0.084 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site