x86/asm/entry/64: Move opportunistic sysret code to syscall code path
authorDenys Vlasenko <dvlasenk@redhat.com>
Thu, 2 Apr 2015 16:46:59 +0000 (18:46 +0200)
committerIngo Molnar <mingo@kernel.org>
Wed, 8 Apr 2015 07:02:12 +0000 (09:02 +0200)
commitfffbb5dcfd29f8831e41b4dd2ab938bd36d35283
tree2125f2510b43c95b1d7c86e41b20bec790c1cec2
parent4bcc7827b02feea2c762fa6d46a1bffb300d7403
x86/asm/entry/64: Move opportunistic sysret code to syscall code path

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.

Acked-and-Tested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Will Drewry <wad@chromium.org>
Link: http://lkml.kernel.org/r/1427993219-7291-1-git-send-email-dvlasenk@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/entry_64.S