aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/kernel/alternative.c7
-rw-r--r--include/asm-i386/alternative.h8
-rw-r--r--include/asm-i386/paravirt.h5
3 files changed, 13 insertions, 7 deletions
diff --git a/arch/i386/kernel/alternative.c b/arch/i386/kernel/alternative.c
index 915b6c4d9baf..dae3ded9041c 100644
--- a/arch/i386/kernel/alternative.c
+++ b/arch/i386/kernel/alternative.c
@@ -325,9 +325,10 @@ void alternatives_smp_switch(int smp)
325#endif 325#endif
326 326
327#ifdef CONFIG_PARAVIRT 327#ifdef CONFIG_PARAVIRT
328void apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end) 328void apply_paravirt(struct paravirt_patch_site *start,
329 struct paravirt_patch_site *end)
329{ 330{
330 struct paravirt_patch *p; 331 struct paravirt_patch_site *p;
331 332
332 for (p = start; p < end; p++) { 333 for (p = start; p < end; p++) {
333 unsigned int used; 334 unsigned int used;
@@ -342,7 +343,7 @@ void apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end)
342 /* Sync to be conservative, in case we patched following instructions */ 343 /* Sync to be conservative, in case we patched following instructions */
343 sync_core(); 344 sync_core();
344} 345}
345extern struct paravirt_patch __start_parainstructions[], 346extern struct paravirt_patch_site __start_parainstructions[],
346 __stop_parainstructions[]; 347 __stop_parainstructions[];
347#endif /* CONFIG_PARAVIRT */ 348#endif /* CONFIG_PARAVIRT */
348 349
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h
index 4d518eebe461..5b59d07e9d29 100644
--- a/include/asm-i386/alternative.h
+++ b/include/asm-i386/alternative.h
@@ -115,12 +115,14 @@ static inline void alternatives_smp_switch(int smp) {}
115#define LOCK_PREFIX "" 115#define LOCK_PREFIX ""
116#endif 116#endif
117 117
118struct paravirt_patch; 118struct paravirt_patch_site;
119#ifdef CONFIG_PARAVIRT 119#ifdef CONFIG_PARAVIRT
120void apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end); 120void apply_paravirt(struct paravirt_patch_site *start,
121 struct paravirt_patch_site *end);
121#else 122#else
122static inline void 123static inline void
123apply_paravirt(struct paravirt_patch *start, struct paravirt_patch *end) 124apply_paravirt(struct paravirt_patch_site *start,
125 struct paravirt_patch_site *end)
124{} 126{}
125#define __start_parainstructions NULL 127#define __start_parainstructions NULL
126#define __stop_parainstructions NULL 128#define __stop_parainstructions NULL
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h
index 61c03f1e0c29..b4cc2fc4031e 100644
--- a/include/asm-i386/paravirt.h
+++ b/include/asm-i386/paravirt.h
@@ -505,13 +505,16 @@ void _paravirt_nop(void);
505#define paravirt_nop ((void *)_paravirt_nop) 505#define paravirt_nop ((void *)_paravirt_nop)
506 506
507/* These all sit in the .parainstructions section to tell us what to patch. */ 507/* These all sit in the .parainstructions section to tell us what to patch. */
508struct paravirt_patch { 508struct paravirt_patch_site {
509 u8 *instr; /* original instructions */ 509 u8 *instr; /* original instructions */
510 u8 instrtype; /* type of this instruction */ 510 u8 instrtype; /* type of this instruction */
511 u8 len; /* length of original instruction */ 511 u8 len; /* length of original instruction */
512 u16 clobbers; /* what registers you may clobber */ 512 u16 clobbers; /* what registers you may clobber */
513}; 513};
514 514
515extern struct paravirt_patch_site __parainstructions[],
516 __parainstructions_end[];
517
515#define paravirt_alt(insn_string, typenum, clobber) \ 518#define paravirt_alt(insn_string, typenum, clobber) \
516 "771:\n\t" insn_string "\n" "772:\n" \ 519 "771:\n\t" insn_string "\n" "772:\n" \
517 ".pushsection .parainstructions,\"a\"\n" \ 520 ".pushsection .parainstructions,\"a\"\n" \