Browse Source

jump label: Make text_poke_early() globally visible

Make text_poke_early available outside of alternative.c. The jump label
patchset wants to make use of it in order to set up the optimal no-op
sequences at run-time.

Signed-off-by: Jason Baron <jbaron@redhat.com>
LKML-Reference: <04cfddf2ba77bcabfc3e524f1849d871d6a1cf9d.1284733808.git.jbaron@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Jason Baron 14 years ago
parent
commit
fa6f2cc770
2 changed files with 4 additions and 2 deletions
  1. 2 0
      arch/x86/include/asm/alternative.h
  2. 2 2
      arch/x86/kernel/alternative.c

+ 2 - 0
arch/x86/include/asm/alternative.h

@@ -160,6 +160,8 @@ static inline void apply_paravirt(struct paravirt_patch_site *start,
 #define __parainstructions_end	NULL
 #define __parainstructions_end	NULL
 #endif
 #endif
 
 
+extern void *text_poke_early(void *addr, const void *opcode, size_t len);
+
 /*
 /*
  * Clear and restore the kernel write-protection flag on the local CPU.
  * Clear and restore the kernel write-protection flag on the local CPU.
  * Allows the kernel to edit read-only pages.
  * Allows the kernel to edit read-only pages.

+ 2 - 2
arch/x86/kernel/alternative.c

@@ -195,7 +195,7 @@ static void __init_or_module add_nops(void *insns, unsigned int len)
 
 
 extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
 extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
 extern s32 __smp_locks[], __smp_locks_end[];
 extern s32 __smp_locks[], __smp_locks_end[];
-static void *text_poke_early(void *addr, const void *opcode, size_t len);
+void *text_poke_early(void *addr, const void *opcode, size_t len);
 
 
 /* Replace instructions with better alternatives for this CPU type.
 /* Replace instructions with better alternatives for this CPU type.
    This runs before SMP is initialized to avoid SMP problems with
    This runs before SMP is initialized to avoid SMP problems with
@@ -522,7 +522,7 @@ void __init alternative_instructions(void)
  * instructions. And on the local CPU you need to be protected again NMI or MCE
  * instructions. And on the local CPU you need to be protected again NMI or MCE
  * handlers seeing an inconsistent instruction while you patch.
  * handlers seeing an inconsistent instruction while you patch.
  */
  */
-static void *__init_or_module text_poke_early(void *addr, const void *opcode,
+void *__init_or_module text_poke_early(void *addr, const void *opcode,
 					      size_t len)
 					      size_t len)
 {
 {
 	unsigned long flags;
 	unsigned long flags;