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

livepatch: Remove klp_check_compiler_support()

The only purpose of klp_check_compiler_support() is to make sure that we
are not using ftrace on x86 via mcount (because that's executed only after
prologue has already happened, and that's too late for livepatching
purposes).

Now that mcount is not supported by ftrace any more, there is no need for
klp_check_compiler_support() either.

Link: http://lkml.kernel.org/r/nycvar.YFH.7.76.1905102346100.17054@cbobk.fhfr.pm

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

authored by

Jiri Kosina and committed by
Steven Rostedt (VMware)
56e33afd 562e14f7

-23
-5
arch/powerpc/include/asm/livepatch.h
··· 24 24 #include <linux/sched/task_stack.h> 25 25 26 26 #ifdef CONFIG_LIVEPATCH 27 - static inline int klp_check_compiler_support(void) 28 - { 29 - return 0; 30 - } 31 - 32 27 static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip) 33 28 { 34 29 regs->nip = ip;
-5
arch/s390/include/asm/livepatch.h
··· 13 13 14 14 #include <asm/ptrace.h> 15 15 16 - static inline int klp_check_compiler_support(void) 17 - { 18 - return 0; 19 - } 20 - 21 16 static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip) 22 17 { 23 18 regs->psw.addr = ip;
-5
arch/x86/include/asm/livepatch.h
··· 24 24 #include <asm/setup.h> 25 25 #include <linux/ftrace.h> 26 26 27 - static inline int klp_check_compiler_support(void) 28 - { 29 - return 0; 30 - } 31 - 32 27 static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip) 33 28 { 34 29 regs->ip = ip;
-8
kernel/livepatch/core.c
··· 1220 1220 1221 1221 static int __init klp_init(void) 1222 1222 { 1223 - int ret; 1224 - 1225 - ret = klp_check_compiler_support(); 1226 - if (ret) { 1227 - pr_info("Your compiler is too old; turning off.\n"); 1228 - return -EINVAL; 1229 - } 1230 - 1231 1223 klp_root_kobj = kobject_create_and_add("livepatch", kernel_kobj); 1232 1224 if (!klp_root_kobj) 1233 1225 return -ENOMEM;