android_kernel_xiaomi_sdm845/arch/x86/xen
Jeremy Fitzhardinge ecb93d1ccd x86/paravirt: add register-saving thunks to reduce caller register pressure
Impact: Optimization

One of the problems with inserting a pile of C calls where previously
there were none is that the register pressure is greatly increased.
The C calling convention says that the caller must expect a certain
set of registers may be trashed by the callee, and that the callee can
use those registers without restriction.  This includes the function
argument registers, and several others.

This patch seeks to alleviate this pressure by introducing wrapper
thunks that will do the register saving/restoring, so that the
callsite doesn't need to worry about it, but the callee function can
be conventional compiler-generated code.  In many cases (particularly
performance-sensitive cases) the callee will be in assembler anyway,
and need not use the compiler's calling convention.

Standard calling convention is:
	 arguments	    return	scratch
x86-32	 eax edx ecx	    eax		?
x86-64	 rdi rsi rdx rcx    rax		r8 r9 r10 r11

The thunk preserves all argument and scratch registers.  The return
register is not preserved, and is available as a scratch register for
unwrapped callee code (and of course the return value).

Wrapped function pointers are themselves wrapped in a struct
paravirt_callee_save structure, in order to get some warning from the
compiler when functions with mismatched calling conventions are used.

The most common paravirt ops, both statically and dynamically, are
interrupt enable/disable/save/restore, so handle them first.  This is
particularly easy since their calls are handled specially anyway.

XXX Deal with VMI.  What's their calling convention?

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-01-30 14:51:45 -08:00
..
debugfs.c xen: add debugfs support 2008-08-21 13:52:58 +02:00
debugfs.h xen: add debugfs support 2008-08-21 13:52:58 +02:00
enlighten.c x86/paravirt: add register-saving thunks to reduce caller register pressure 2009-01-30 14:51:45 -08:00
grant-table.c xen: make grant table arch portable 2008-04-24 23:57:32 +02:00
irq.c x86/paravirt: add register-saving thunks to reduce caller register pressure 2009-01-30 14:51:45 -08:00
Kconfig xen: make CONFIG_XEN_SAVE_RESTORE depend on CONFIG_XEN 2008-09-30 09:58:05 +02:00
Makefile ftrace: rename FTRACE to FUNCTION_TRACER 2008-10-20 18:27:03 +02:00
mmu.c xen: move remaining mmu-related stuff into mmu.c 2009-01-30 14:51:14 -08:00
mmu.h xen: move remaining mmu-related stuff into mmu.c 2009-01-30 14:51:14 -08:00
multicalls.c xen: whitespace/checkpatch cleanup 2008-12-16 21:05:01 +01:00
multicalls.h percpu: add optimized generic percpu accessors 2009-01-16 14:20:31 +01:00
setup.c xen: whitespace/checkpatch cleanup 2008-12-16 21:05:01 +01:00
smp.c x86: initialize per-cpu GDT segment in per-cpu setup 2009-01-27 12:56:48 +09:00
spinlock.c genirq: revert dynarray 2008-10-16 16:53:15 +02:00
suspend.c x86, xen: fix hardirq.h merge fallout 2009-01-23 11:09:15 +01:00
time.c Merge branch 'cputime' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2009-01-03 11:56:24 -08:00
vdso.h i386: move xen 2007-10-11 11:16:51 +02:00
xen-asm_32.S xen: compile irq functions without -pg for ftrace 2008-07-31 12:39:39 +02:00
xen-asm_64.S x86-64: Move oldrsp from PDA to per-cpu. 2009-01-19 00:38:58 +09:00
xen-head.S xen64: add xen-head code to head_64.S 2008-07-16 10:58:41 +02:00
xen-ops.h xen: move remaining mmu-related stuff into mmu.c 2009-01-30 14:51:14 -08:00