[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171121023419.vs6mpg3ip5xklmvl@treble>
Date: Mon, 20 Nov 2017 20:34:19 -0600
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Andy Lutomirski <luto@...nel.org>
Cc: X86 ML <x86@...nel.org>, Borislav Petkov <bpetkov@...e.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Brian Gerst <brgerst@...il.com>,
Dave Hansen <dave.hansen@...el.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [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
Powered by blists - more mailing lists