Re: [PATCH] x86/asm/entry/64: move opportunistic sysret code to syscall code path

Borislav Petkov
2015-04-07T15:28:47Z

On Thu, Apr 02, 2015 at 06:46:59PM +0200, Denys Vlasenko wrote:
> This change does two things:
>
> Copy-pastes "retint_swapgs:" code into syscall handling code,
> the copy is under "syscall_return:" label. The code is unchanged
> apart from some label renames.
>
> Removes "opportunistic sysret" code from "retint_swapgs:" code block,
> since now it won't be reached by syscall return. This in fact removes
> most of the code in question.
>
> text data bss dec hex filename
> 12530 0 0 12530 30f2 entry_64.o.before
> 12562 0 0 12562 3112 entry_64.o
>
> Run-tested.
>
> Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
> CC: Linus Torvalds <torvalds@linux-foundation.org>
> CC: Steven Rostedt <rostedt@goodmis.org>
> CC: Ingo Molnar <mingo@kernel.org>
> CC: Borislav Petkov <bp@alien8.de>
> CC: "H. Peter Anvin" <hpa@zytor.com>
> CC: Andy Lutomirski <luto@amacapital.net>
> CC: Oleg Nesterov <oleg@redhat.com>
> CC: Frederic Weisbecker <fweisbec@gmail.com>
> CC: Alexei Starovoitov <ast@plumgrid.com>
> CC: Will Drewry <wad@chromium.org>
> CC: Kees Cook <keescook@chromium.org>
> CC: x86@kernel.org
> CC: linux-kernel@vger.kernel.org
> ---
> arch/x86/kernel/entry_64.S | 158 ++++++++++++++++++++++++---------------------
> 1 file changed, 86 insertions(+), 72 deletions(-)

Acked-and-tested-by: Borislav Petkov <bp@suse.de>

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--