Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Nadav Amit and committed by
Ingo Molnar
0a203df5 bb0a008d

+6 -9
+2 -2
arch/x86/include/asm/text-patching.h
··· 18 18 #define __parainstructions_end NULL 19 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 24 * Clear and restore the kernel write-protection flag on the local CPU. ··· 37 37 extern void *text_poke(void *addr, const void *opcode, size_t len); 38 38 extern void *text_poke_kgdb(void *addr, const void *opcode, size_t len); 39 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 41 extern int after_bootmem; 42 42 extern __ro_after_init struct mm_struct *poking_mm; 43 43 extern __ro_after_init unsigned long poking_addr;
+4 -7
arch/x86/kernel/alternative.c
··· 265 265 266 266 extern struct alt_instr __alt_instructions[], __alt_instructions_end[]; 267 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 271 * Are we looking at a near JMP with a 1 or 4-byte displacement. ··· 667 667 * instructions. And on the local CPU you need to be protected again NMI or MCE 668 668 * handlers seeing an inconsistent instruction while you patch. 669 669 */ 670 - void *__init_or_module text_poke_early(void *addr, const void *opcode, 671 - size_t len) 670 + void __init_or_module text_poke_early(void *addr, const void *opcode, 671 + size_t len) 672 672 { 673 673 unsigned long flags; 674 674 ··· 691 691 * that causes hangs on some VIA CPUs. 692 692 */ 693 693 } 694 - return addr; 695 694 } 696 695 697 696 __ro_after_init struct mm_struct *poking_mm; ··· 892 893 * replacing opcode 893 894 * - sync cores 894 895 */ 895 - void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) 896 + void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) 896 897 { 897 898 unsigned char int3 = 0xcc; 898 899 ··· 934 935 * the writing of the new instruction. 935 936 */ 936 937 bp_patching_in_progress = false; 937 - 938 - return addr; 939 938 } 940 939