linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] x86: entry_64.S: steps towards simpler iret frame handling
@ 2015-03-08 20:49 Denys Vlasenko
  2015-03-08 20:49 ` [PATCH 1/2] x86: save r11 into pt_regs->flags on SYSCALL64 fastpath Denys Vlasenko
  2015-03-08 20:49 ` [PATCH 2/2] x86: save user %rsp in pt_regs->sp " Denys Vlasenko
  0 siblings, 2 replies; 5+ messages in thread
From: Denys Vlasenko @ 2015-03-08 20:49 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Denys Vlasenko, Linus Torvalds, Steven Rostedt, Ingo Molnar,
	Borislav Petkov, H. Peter Anvin, Oleg Nesterov,
	Frederic Weisbecker, Alexei Starovoitov, Will Drewry, Kees Cook,
	x86, linux-kernel

These changes make SYSENTER64 code path save flags and user's
stack pointer in pt_regs->flags and pt_regs->sp, where they belong.

As a result, we can drop stub_iopl() and thread_struct::usersp.

Usage of PER_CPU(old_rsp) is reduced to bare minimum.

FIXUP/RESTORE_TOP_OF_STACK macros are on diet too.

(This is a resend. Previous version was on top of KERNEL_STACK_OFFSET
removal patch. This one is on top of Andy's current git. Patch is run-tested.)

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

Denys Vlasenko (2):
  x86: save r11 into pt_regs->flags on SYSCALL64 fastpath
  x86: save user %rsp in pt_regs->sp on SYSCALL64 fastpath

 arch/x86/include/asm/calling.h   | 20 +++++++++-----
 arch/x86/include/asm/compat.h    |  2 +-
 arch/x86/include/asm/processor.h |  6 -----
 arch/x86/include/asm/ptrace.h    |  8 ++----
 arch/x86/kernel/entry_64.S       | 57 ++++++++++++++--------------------------
 arch/x86/kernel/perf_regs.c      |  2 +-
 arch/x86/kernel/process_64.c     |  8 +-----
 arch/x86/syscalls/syscall_64.tbl |  2 +-
 arch/x86/um/sys_call_table_64.c  |  2 +-
 9 files changed, 40 insertions(+), 67 deletions(-)

-- 
1.8.1.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-09 16:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-08 20:49 [PATCH 0/2] x86: entry_64.S: steps towards simpler iret frame handling Denys Vlasenko
2015-03-08 20:49 ` [PATCH 1/2] x86: save r11 into pt_regs->flags on SYSCALL64 fastpath Denys Vlasenko
2015-03-09 16:02   ` Ingo Molnar
2015-03-08 20:49 ` [PATCH 2/2] x86: save user %rsp in pt_regs->sp " Denys Vlasenko
2015-03-09 16:18   ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).