lkml.org 
[lkml]   [2017]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 13/16] x86/entry/64: Create a percpu SYSCALL entry trampoline
On Mon, Nov 20, 2017 at 09:07:44AM -0800, Andy Lutomirski wrote:
> + /* Save RDI, since we need a scratch register. */
> + pushq %rdi
> +
> + /*
> + * x86 lacks a near absolute jump, and we can't jump to the real
> + * entry text with a relative jump, so we use a double trampoline.
> + */
> + movq $entry_SYSCALL_64_stage2, %rdi
> + jmp *%rdi
> +END(entry_SYSCALL_64_trampoline)
> +
> + .popsection
> +
> +ENTRY(entry_SYSCALL_64_stage2)
> + /*
> + * Rather than polluting the normal SYSCALL path with stack switching
> + * nonsense, fix up our register state to match its expectations.
> + */
> + UNWIND_HINT_EMPTY
> + popq %rdi
> + jmp entry_SYSCALL_64_after_hwframe
> +END(entry_SYSCALL_64_stage2)

Is there a reason why you couldn't just do the following?

pushq $entry_SYSCALL_64_after_hwframe
ret

Then you wouldn't need the 2nd trampoline and the %rdi clobber.

--
Josh

\
 
 \ /
  Last update: 2017-11-21 03:35    [W:0.201 / U:0.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site