aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/paravirt.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2009-01-28 17:35:02 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2009-01-30 17:51:44 -0500
commit41edafdb78feac1d1f8823846209975fde990633 (patch)
tree00bb95195332962916be365c6119f17a22770758 /arch/x86/include/asm/paravirt.h
parent319f3ba52c71630865b10ac3b99dd020440d681d (diff)
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/include/asm/paravirt.h')
-rw-r--r--arch/x86/include/asm/paravirt.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index 175778887090..961d10c12f16 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -388,6 +388,8 @@ extern struct pv_lock_ops pv_lock_ops;
388 asm("start_" #ops "_" #name ": " code "; end_" #ops "_" #name ":") 388 asm("start_" #ops "_" #name ": " code "; end_" #ops "_" #name ":")
389 389
390unsigned paravirt_patch_nop(void); 390unsigned paravirt_patch_nop(void);
391unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len);
392unsigned paravirt_patch_ident_64(void *insnbuf, unsigned len);
391unsigned paravirt_patch_ignore(unsigned len); 393unsigned paravirt_patch_ignore(unsigned len);
392unsigned paravirt_patch_call(void *insnbuf, 394unsigned paravirt_patch_call(void *insnbuf,
393 const void *target, u16 tgt_clobbers, 395 const void *target, u16 tgt_clobbers,
@@ -1371,6 +1373,9 @@ static inline void __set_fixmap(unsigned /* enum fixed_addresses */ idx,
1371} 1373}
1372 1374
1373void _paravirt_nop(void); 1375void _paravirt_nop(void);
1376u32 _paravirt_ident_32(u32);
1377u64 _paravirt_ident_64(u64);
1378
1374#define paravirt_nop ((void *)_paravirt_nop) 1379#define paravirt_nop ((void *)_paravirt_nop)
1375 1380
1376void paravirt_use_bytelocks(void); 1381void paravirt_use_bytelocks(void);