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

From: Borislav Petkov
Date: Tue Apr 07 2015 - 11:28:49 EST


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@xxxxxxxxxx>
> CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> CC: Steven Rostedt <rostedt@xxxxxxxxxxx>
> CC: Ingo Molnar <mingo@xxxxxxxxxx>
> CC: Borislav Petkov <bp@xxxxxxxxx>
> CC: "H. Peter Anvin" <hpa@xxxxxxxxx>
> CC: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
> CC: Oleg Nesterov <oleg@xxxxxxxxxx>
> CC: Frederic Weisbecker <fweisbec@xxxxxxxxx>
> CC: Alexei Starovoitov <ast@xxxxxxxxxxxx>
> CC: Will Drewry <wad@xxxxxxxxxxxx>
> CC: Kees Cook <keescook@xxxxxxxxxxxx>
> CC: x86@xxxxxxxxxx
> CC: linux-kernel@xxxxxxxxxxxxxxx
> ---
> arch/x86/kernel/entry_64.S | 158 ++++++++++++++++++++++++---------------------
> 1 file changed, 86 insertions(+), 72 deletions(-)

Acked-and-tested-by: Borislav Petkov <bp@xxxxxxx>

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/