summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNadav Amit <namit@vmware.com>2019-04-25 20:11:33 -0400
committerIngo Molnar <mingo@kernel.org>2019-04-30 06:37:56 -0400
commit0a203df5cf0eb709be4f190314e262b72d7e5b76 (patch)
tree63ed4651de22e1272b163d58fe4f374c80342a5a
parentbb0a008d6a2c543efc11313b448d2f26f91dc4f8 (diff)
x86/alternatives: Remove the return value of text_poke_*()
The return value of text_poke_early() and text_poke_bp() is useless. Remove it. Signed-off-by: Nadav Amit <namit@vmware.com> Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: <akpm@linux-foundation.org> Cc: <ard.biesheuvel@linaro.org> Cc: <deneen.t.dock@intel.com> Cc: <kernel-hardening@lists.openwall.com> Cc: <kristen@linux.intel.com> Cc: <linux_dti@icloud.com> Cc: <will.deacon@arm.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@intel.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Kees Cook <keescook@chromium.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Rik van Riel <riel@surriel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20190426001143.4983-14-namit@vmware.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/include/asm/text-patching.h4
-rw-r--r--arch/x86/kernel/alternative.c11
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
21extern void *text_poke_early(void *addr, const void *opcode, size_t len); 21extern 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);
37extern void *text_poke(void *addr, const void *opcode, size_t len); 37extern void *text_poke(void *addr, const void *opcode, size_t len);
38extern void *text_poke_kgdb(void *addr, const void *opcode, size_t len); 38extern void *text_poke_kgdb(void *addr, const void *opcode, size_t len);
39extern int poke_int3_handler(struct pt_regs *regs); 39extern int poke_int3_handler(struct pt_regs *regs);
40extern void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler); 40extern void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler);
41extern int after_bootmem; 41extern int after_bootmem;
42extern __ro_after_init struct mm_struct *poking_mm; 42extern __ro_after_init struct mm_struct *poking_mm;
43extern __ro_after_init unsigned long poking_addr; 43extern __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
266extern struct alt_instr __alt_instructions[], __alt_instructions_end[]; 266extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
267extern s32 __smp_locks[], __smp_locks_end[]; 267extern s32 __smp_locks[], __smp_locks_end[];
268void *text_poke_early(void *addr, const void *opcode, size_t len); 268void 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 */
670void *__init_or_module text_poke_early(void *addr, const void *opcode, 670void __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 */
896void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) 895void 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