diff options
-rw-r--r-- | arch/x86/include/asm/text-patching.h | 4 | ||||
-rw-r--r-- | arch/x86/kernel/alternative.c | 11 |
2 files changed, 6 insertions, 9 deletions
diff --git a/arch/x86/include/asm/text-patching.h b/arch/x86/include/asm/text-patching.h index a75eed841eed..c90678fd391a 100644 --- a/arch/x86/include/asm/text-patching.h +++ b/arch/x86/include/asm/text-patching.h | |||
@@ -18,7 +18,7 @@ static inline void apply_paravirt(struct paravirt_patch_site *start, | |||
18 | #define __parainstructions_end NULL | 18 | #define __parainstructions_end NULL |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | extern void *text_poke_early(void *addr, const void *opcode, size_t len); | 21 | extern void text_poke_early(void *addr, const void *opcode, size_t len); |
22 | 22 | ||
23 | /* | 23 | /* |
24 | * Clear and restore the kernel write-protection flag on the local CPU. | 24 | * Clear and restore the kernel write-protection flag on the local CPU. |
@@ -37,7 +37,7 @@ extern void *text_poke_early(void *addr, const void *opcode, size_t len); | |||
37 | extern void *text_poke(void *addr, const void *opcode, size_t len); | 37 | extern void *text_poke(void *addr, const void *opcode, size_t len); |
38 | extern void *text_poke_kgdb(void *addr, const void *opcode, size_t len); | 38 | extern void *text_poke_kgdb(void *addr, const void *opcode, size_t len); |
39 | extern int poke_int3_handler(struct pt_regs *regs); | 39 | extern int poke_int3_handler(struct pt_regs *regs); |
40 | extern void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler); | 40 | extern void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler); |
41 | extern int after_bootmem; | 41 | extern int after_bootmem; |
42 | extern __ro_after_init struct mm_struct *poking_mm; | 42 | extern __ro_after_init struct mm_struct *poking_mm; |
43 | extern __ro_after_init unsigned long poking_addr; | 43 | extern __ro_after_init unsigned long poking_addr; |
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 3d2b6b6fb20c..18f959975ea0 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c | |||
@@ -265,7 +265,7 @@ static void __init_or_module add_nops(void *insns, unsigned int len) | |||
265 | 265 | ||
266 | extern struct alt_instr __alt_instructions[], __alt_instructions_end[]; | 266 | extern struct alt_instr __alt_instructions[], __alt_instructions_end[]; |
267 | extern s32 __smp_locks[], __smp_locks_end[]; | 267 | extern s32 __smp_locks[], __smp_locks_end[]; |
268 | void *text_poke_early(void *addr, const void *opcode, size_t len); | 268 | void text_poke_early(void *addr, const void *opcode, size_t len); |
269 | 269 | ||
270 | /* | 270 | /* |
271 | * Are we looking at a near JMP with a 1 or 4-byte displacement. | 271 | * Are we looking at a near JMP with a 1 or 4-byte displacement. |
@@ -667,8 +667,8 @@ void __init alternative_instructions(void) | |||
667 | * instructions. And on the local CPU you need to be protected again NMI or MCE | 667 | * instructions. And on the local CPU you need to be protected again NMI or MCE |
668 | * handlers seeing an inconsistent instruction while you patch. | 668 | * handlers seeing an inconsistent instruction while you patch. |
669 | */ | 669 | */ |
670 | void *__init_or_module text_poke_early(void *addr, const void *opcode, | 670 | void __init_or_module text_poke_early(void *addr, const void *opcode, |
671 | size_t len) | 671 | size_t len) |
672 | { | 672 | { |
673 | unsigned long flags; | 673 | unsigned long flags; |
674 | 674 | ||
@@ -691,7 +691,6 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode, | |||
691 | * that causes hangs on some VIA CPUs. | 691 | * that causes hangs on some VIA CPUs. |
692 | */ | 692 | */ |
693 | } | 693 | } |
694 | return addr; | ||
695 | } | 694 | } |
696 | 695 | ||
697 | __ro_after_init struct mm_struct *poking_mm; | 696 | __ro_after_init struct mm_struct *poking_mm; |
@@ -893,7 +892,7 @@ NOKPROBE_SYMBOL(poke_int3_handler); | |||
893 | * replacing opcode | 892 | * replacing opcode |
894 | * - sync cores | 893 | * - sync cores |
895 | */ | 894 | */ |
896 | void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) | 895 | void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) |
897 | { | 896 | { |
898 | unsigned char int3 = 0xcc; | 897 | unsigned char int3 = 0xcc; |
899 | 898 | ||
@@ -935,7 +934,5 @@ void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) | |||
935 | * the writing of the new instruction. | 934 | * the writing of the new instruction. |
936 | */ | 935 | */ |
937 | bp_patching_in_progress = false; | 936 | bp_patching_in_progress = false; |
938 | |||
939 | return addr; | ||
940 | } | 937 | } |
941 | 938 | ||