diff options
author | Jan Beulich <JBeulich@novell.com> | 2009-12-18 11:12:56 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-30 05:57:31 -0500 |
commit | 1b1d9258181bae199dc940f4bd0298126b9a73d9 (patch) | |
tree | b17ca149d943051fc76e79b75fc4b89c61b524a2 /arch/x86/include/asm/alternative.h | |
parent | 499a5f1efa0b0ac56ec5d060412aed84ae68e63e (diff) |
x86-64: Modify copy_user_generic() alternatives mechanism
In order to avoid unnecessary chains of branches, rather than
implementing copy_user_generic() as a function consisting of
just a single (possibly patched) branch, instead properly deal
with patching call instructions in the alternative instructions
framework, and move the patching into the callers.
As a follow-on, one could also introduce something like
__EXPORT_SYMBOL_ALT() to avoid patching call sites in modules.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <4B2BB8180200007800026AE7@vpn.id2.novell.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/include/asm/alternative.h')
-rw-r--r-- | arch/x86/include/asm/alternative.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/include/asm/alternative.h b/arch/x86/include/asm/alternative.h index 69b74a7b877f..3b5b828767b6 100644 --- a/arch/x86/include/asm/alternative.h +++ b/arch/x86/include/asm/alternative.h | |||
@@ -125,11 +125,16 @@ static inline void alternatives_smp_switch(int smp) {} | |||
125 | asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \ | 125 | asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) \ |
126 | : output : "i" (0), ## input) | 126 | : output : "i" (0), ## input) |
127 | 127 | ||
128 | /* Like alternative_io, but for replacing a direct call with another one. */ | ||
129 | #define alternative_call(oldfunc, newfunc, feature, output, input...) \ | ||
130 | asm volatile (ALTERNATIVE("call %P[old]", "call %P[new]", feature) \ | ||
131 | : output : [old] "i" (oldfunc), [new] "i" (newfunc), ## input) | ||
132 | |||
128 | /* | 133 | /* |
129 | * use this macro(s) if you need more than one output parameter | 134 | * use this macro(s) if you need more than one output parameter |
130 | * in alternative_io | 135 | * in alternative_io |
131 | */ | 136 | */ |
132 | #define ASM_OUTPUT2(a, b) a, b | 137 | #define ASM_OUTPUT2(a...) a |
133 | 138 | ||
134 | struct paravirt_patch_site; | 139 | struct paravirt_patch_site; |
135 | #ifdef CONFIG_PARAVIRT | 140 | #ifdef CONFIG_PARAVIRT |