]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
x86/pvops: add a paravirt_ident functions to allow special patching
authorJeremy Fitzhardinge <jeremy@goop.org>
Wed, 28 Jan 2009 22:35:02 +0000 (14:35 -0800)
committerH. Peter Anvin <hpa@linux.intel.com>
Fri, 30 Jan 2009 22:51:44 +0000 (14:51 -0800)
commit41edafdb78feac1d1f8823846209975fde990633
tree00bb95195332962916be365c6119f17a22770758
parent319f3ba52c71630865b10ac3b99dd020440d681d
x86/pvops: add a paravirt_ident functions to allow special patching

Impact: Optimization

Several paravirt ops implementations simply return their arguments,
the most obvious being the make_pte/pte_val class of operations on
native.

On 32-bit, the identity function is literally a no-op, as the calling
convention uses the same registers for the first argument and return.
On 64-bit, it can be implemented with a single "mov".

This patch adds special identity functions for 32 and 64 bit argument,
and machinery to recognize them and replace them with either nops or a
mov as appropriate.

At the moment, the only users for the identity functions are the
pagetable entry conversion functions.

The result is a measureable improvement on pagetable-heavy benchmarks
(2-3%, reducing the pvops overhead from 5 to 2%).

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/include/asm/paravirt.h
arch/x86/kernel/paravirt.c
arch/x86/kernel/paravirt_patch_32.c
arch/x86/kernel/paravirt_patch_64.c