linux/arch/x86/entry
Andy Lutomirski 7841b40871 x86/entry/compat: Implement opportunistic SYSRETL for compat syscalls
If CS, SS and IP are as expected and FLAGS is compatible with
SYSRETL, then return from fast compat syscalls (both SYSCALL and
SYSENTER) using SYSRETL.

Unlike native 64-bit opportunistic SYSRET, this is not invisible
to user code: RCX and R8-R15 end up in a different state than
shown saved in pt_regs.  To compensate, we only do this when
returning to the vDSO fast syscall return path.  This won't
interfere with syscall restart, as we won't use SYSRETL when
returning to the INT80 restart instruction.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/r/aa15e49db33773eb10b73d73466b6d5466d7856a.1444091585.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-10-09 09:41:10 +02:00
..
syscalls x86/entry/64/compat: Set up full pt_regs for all compat syscalls 2015-10-09 09:41:07 +02:00
vdso x86/vdso/compat: Wire up SYSENTER and SYSCSALL for compat userspace 2015-10-09 09:41:09 +02:00
vsyscall x86/entry/vsyscall: Fix undefined symbol warning 2015-09-21 09:56:59 +02:00
calling.h x86/asm/entry/64: Save all regs on interrupt entry 2015-07-07 10:59:07 +02:00
common.c x86/entry/compat: Implement opportunistic SYSRETL for compat syscalls 2015-10-09 09:41:10 +02:00
entry_32.S x86/entry, locking/lockdep: Move lockdep_sys_exit() to prepare_exit_to_usermode() 2015-10-07 11:34:07 +02:00
entry_64.S x86/entry/64/compat: Migrate the body of the syscall entry to C 2015-10-09 09:41:09 +02:00
entry_64_compat.S x86/entry/compat: Implement opportunistic SYSRETL for compat syscalls 2015-10-09 09:41:10 +02:00
Makefile x86/entry: Move C entry and exit code to arch/x86/entry/common.c 2015-07-07 10:59:05 +02:00
syscall_32.c x86/syscalls: Give sys_call_ptr_t a useful type 2015-10-09 09:41:08 +02:00
syscall_64.c x86/syscalls: Give sys_call_ptr_t a useful type 2015-10-09 09:41:08 +02:00
thunk_32.S Merge branch 'x86-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-06-22 17:59:09 -07:00
thunk_64.S Merge branch 'x86-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-06-22 17:59:09 -07:00