diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2009-01-28 14:35:02 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2009-01-30 14:51:44 -0800 |
commit | 41edafdb78feac1d1f8823846209975fde990633 (patch) | |
tree | 00bb95195332962916be365c6119f17a22770758 /arch/x86/kernel/paravirt_patch_32.c | |
parent | 319f3ba52c71630865b10ac3b99dd020440d681d (diff) | |
download | kernel-crypto-41edafdb78feac1d1f8823846209975fde990633.tar.gz kernel-crypto-41edafdb78feac1d1f8823846209975fde990633.tar.xz kernel-crypto-41edafdb78feac1d1f8823846209975fde990633.zip |
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>
Diffstat (limited to 'arch/x86/kernel/paravirt_patch_32.c')
-rw-r--r-- | arch/x86/kernel/paravirt_patch_32.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kernel/paravirt_patch_32.c b/arch/x86/kernel/paravirt_patch_32.c index 9fe644f4861..d9f32e6d6ab 100644 --- a/arch/x86/kernel/paravirt_patch_32.c +++ b/arch/x86/kernel/paravirt_patch_32.c @@ -12,6 +12,18 @@ DEF_NATIVE(pv_mmu_ops, read_cr3, "mov %cr3, %eax"); DEF_NATIVE(pv_cpu_ops, clts, "clts"); DEF_NATIVE(pv_cpu_ops, read_tsc, "rdtsc"); +unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len) +{ + /* arg in %eax, return in %eax */ + return 0; +} + +unsigned paravirt_patch_ident_64(void *insnbuf, unsigned len) +{ + /* arg in %edx:%eax, return in %edx:%eax */ + return 0; +} + unsigned native_patch(u8 type, u16 clobbers, void *ibuf, unsigned long addr, unsigned len) { |