linux/arch/x86/entry
Andy Lutomirski 8242c6c84a x86/vdso/32: Save extra registers in the INT80 vsyscall path
The goal is to integrate the SYSENTER and SYSCALL32 entry paths
with the INT80 path.  SYSENTER clobbers ESP and EIP.  SYSCALL32
clobbers ECX (and, invisibly, R11).  SYSRETL (long mode to
compat mode) clobbers ECX and, invisibly, R11.  SYSEXIT (which
we only need for native 32-bit) clobbers ECX and EDX.

This means that we'll need to provide ESP to the kernel in a
register (I chose ECX, since it's only needed for SYSENTER) and
we need to provide the args that normally live in ECX and EDX in
memory.

The epilogue needs to restore ECX and EDX, since user code
relies on regs being preserved.

We don't need to do anything special about EIP, since the kernel
already knows where we are.  The kernel will eventually need to
know where int $0x80 lands, so add a vdso_image entry for it.

The only user-visible effect of this code is that ptrace-induced
changes to ECX and EDX during fast syscalls will be lost.  This
is already the case for the SYSENTER path.

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/b860925adbee2d2627a0671fbfe23a7fd04127f8.1444091584.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-10-09 09:41:06 +02:00
..
syscalls sys_membarrier(): system-wide memory barrier (generic, x86) 2015-09-11 15:21:34 -07:00
vdso x86/vdso/32: Save extra registers in the INT80 vsyscall path 2015-10-09 09:41:06 +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, locking/lockdep: Move lockdep_sys_exit() to prepare_exit_to_usermode() 2015-10-07 11:34:07 +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, locking/lockdep: Move lockdep_sys_exit() to prepare_exit_to_usermode() 2015-10-07 11:34:07 +02:00
entry_64_compat.S x86/entry/64/compat: After SYSENTER, move STI after the NT fixup 2015-10-07 11:34:08 +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
syscall_64.c
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