]> git.baikalelectronics.ru Git - kernel.git/commit
x86-64: Slightly shorten line system call entry and exit paths
authorJan Beulich <JBeulich@suse.com>
Tue, 29 Nov 2011 11:17:45 +0000 (11:17 +0000)
committerIngo Molnar <mingo@elte.hu>
Mon, 5 Dec 2011 16:24:41 +0000 (17:24 +0100)
commitf2382091c347aa815af867d267d7500417ce88de
tree1134b3244ebe89208856c35bf86138d2b1ed791e
parentdb15c34b923ea324c13099a07e38239b75581ccc
x86-64: Slightly shorten line system call entry and exit paths

GET_THREAD_INFO() involves a memory read immediately followed by
an "sub" on the value read, in turn (in several cases)
immediately followed by a use of the calculated value as the
base address of a memory access. This combination of
instructions has a non-negligible potential for stalls.

In the system call entry point code, however, the (fixed) offset
of the stack pointer from the end of the stack is generally
known, and hence we can instead avoid the memory load and
subtract, and instead do the memory reference using %rsp as the
base register. To do so in a legible fashion, introduce a
THREAD_INFO() macro which, provided a register (generally %rsp)
and the known offset from the end of the stack, produces a
suitable memory access operand.

The patch attempts to only touch the fast paths (no auditing and
alike), but manages to do so only in the 64-bit entry point
case; the compatibility mode entry points have so many
interdependencies between their various branch targets that it
was necessary to also adjust the slow paths to eliminate the
risk of having missed some register dependency during code
analysis.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/4ED4CD690200007800064075@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/ia32/ia32entry.S
arch/x86/include/asm/thread_info.h
arch/x86/kernel/entry_64.S