Commit 0a203df5 authored by Nadav Amit's avatar Nadav Amit Committed by Ingo Molnar

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: default avatarNadav Amit <namit@vmware.com>
Signed-off-by: default avatarRick Edgecombe <rick.p.edgecombe@intel.com>
Signed-off-by: default avatarPeter 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.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent bb0a008d
...@@ -18,7 +18,7 @@ static inline void apply_paravirt(struct paravirt_patch_site *start, ...@@ -18,7 +18,7 @@ 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); 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.
...@@ -37,7 +37,7 @@ extern void *text_poke_early(void *addr, const void *opcode, size_t len); ...@@ -37,7 +37,7 @@ extern void *text_poke_early(void *addr, const void *opcode, size_t len);
extern void *text_poke(void *addr, const void *opcode, size_t len); extern void *text_poke(void *addr, const void *opcode, size_t len);
extern void *text_poke_kgdb(void *addr, const void *opcode, size_t len); extern void *text_poke_kgdb(void *addr, const void *opcode, size_t len);
extern int poke_int3_handler(struct pt_regs *regs); extern int poke_int3_handler(struct pt_regs *regs);
extern void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler); extern void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler);
extern int after_bootmem; extern int after_bootmem;
extern __ro_after_init struct mm_struct *poking_mm; extern __ro_after_init struct mm_struct *poking_mm;
extern __ro_after_init unsigned long poking_addr; extern __ro_after_init unsigned long poking_addr;
......
...@@ -265,7 +265,7 @@ static void __init_or_module add_nops(void *insns, unsigned int len) ...@@ -265,7 +265,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[];
void *text_poke_early(void *addr, const void *opcode, size_t len); void text_poke_early(void *addr, const void *opcode, size_t len);
/* /*
* Are we looking at a near JMP with a 1 or 4-byte displacement. * Are we looking at a near JMP with a 1 or 4-byte displacement.
...@@ -667,8 +667,8 @@ void __init alternative_instructions(void) ...@@ -667,8 +667,8 @@ 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.
*/ */
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;
...@@ -691,7 +691,6 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode, ...@@ -691,7 +691,6 @@ void *__init_or_module text_poke_early(void *addr, const void *opcode,
* that causes hangs on some VIA CPUs. * that causes hangs on some VIA CPUs.
*/ */
} }
return addr;
} }
__ro_after_init struct mm_struct *poking_mm; __ro_after_init struct mm_struct *poking_mm;
...@@ -893,7 +892,7 @@ NOKPROBE_SYMBOL(poke_int3_handler); ...@@ -893,7 +892,7 @@ NOKPROBE_SYMBOL(poke_int3_handler);
* replacing opcode * replacing opcode
* - sync cores * - sync cores
*/ */
void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) void text_poke_bp(void *addr, const void *opcode, size_t len, void *handler)
{ {
unsigned char int3 = 0xcc; unsigned char int3 = 0xcc;
...@@ -935,7 +934,5 @@ void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler) ...@@ -935,7 +934,5 @@ void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler)
* the writing of the new instruction. * the writing of the new instruction.
*/ */
bp_patching_in_progress = false; bp_patching_in_progress = false;
return addr;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment