]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
livepatch: Remove klp_check_compiler_support()
authorJiri Kosina <jkosina@suse.cz>
Fri, 10 May 2019 21:47:50 +0000 (23:47 +0200)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 10 May 2019 21:53:29 +0000 (17:53 -0400)
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>
arch/powerpc/include/asm/livepatch.h
arch/s390/include/asm/livepatch.h
arch/x86/include/asm/livepatch.h
kernel/livepatch/core.c

index 5070df19d4638e60dc9ede36058f27027e3f9a23..c005aee5ea437f32f22853b4280bb47c2f1e1212 100644 (file)
 #include <linux/sched/task_stack.h>
 
 #ifdef CONFIG_LIVEPATCH
-static inline int klp_check_compiler_support(void)
-{
-       return 0;
-}
-
 static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip)
 {
        regs->nip = ip;
index 672f95b12d4065b4fa023444dbd5575ca71d767e..818612b784cda2a77960461d1eb0c720c29f925d 100644 (file)
 
 #include <asm/ptrace.h>
 
-static inline int klp_check_compiler_support(void)
-{
-       return 0;
-}
-
 static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip)
 {
        regs->psw.addr = ip;
index 2f2bdf0662f894b4e5148ec3317a4d73e83553e1..a66f6706c2dee30ef016ead0fa77dc55561a001e 100644 (file)
 #include <asm/setup.h>
 #include <linux/ftrace.h>
 
-static inline int klp_check_compiler_support(void)
-{
-       return 0;
-}
-
 static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip)
 {
        regs->ip = ip;
index eb0ee10a1981224e2ba87939af9beec839bd3a60..112a36ed4a09ce37d6834827b6d68e4f4b0c8f5f 100644 (file)
@@ -1220,14 +1220,6 @@ void klp_module_going(struct module *mod)
 
 static int __init klp_init(void)
 {
-       int ret;
-
-       ret = klp_check_compiler_support();
-       if (ret) {
-               pr_info("Your compiler is too old; turning off.\n");
-               return -EINVAL;
-       }
-
        klp_root_kobj = kobject_create_and_add("livepatch", kernel_kobj);
        if (!klp_root_kobj)
                return -ENOMEM;