Skip to content

Commit 56e33af

Browse files
Jiri Kosinarostedt
authored andcommitted
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>
1 parent 562e14f commit 56e33af

4 files changed

Lines changed: 0 additions & 23 deletions

File tree

‎arch/powerpc/include/asm/livepatch.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
#include <linux/sched/task_stack.h>
2525

2626
#ifdef CONFIG_LIVEPATCH
27-
static inline int klp_check_compiler_support(void)
28-
{
29-
return 0;
30-
}
31-
3227
static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip)
3328
{
3429
regs->nip = ip;

‎arch/s390/include/asm/livepatch.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313

1414
#include <asm/ptrace.h>
1515

16-
static inline int klp_check_compiler_support(void)
17-
{
18-
return 0;
19-
}
20-
2116
static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip)
2217
{
2318
regs->psw.addr = ip;

‎arch/x86/include/asm/livepatch.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
#include <asm/setup.h>
2525
#include <linux/ftrace.h>
2626

27-
static inline int klp_check_compiler_support(void)
28-
{
29-
return 0;
30-
}
31-
3227
static inline void klp_arch_set_pc(struct pt_regs *regs, unsigned long ip)
3328
{
3429
regs->ip = ip;

‎kernel/livepatch/core.c‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,14 +1220,6 @@ void klp_module_going(struct module *mod)
12201220

12211221
static int __init klp_init(void)
12221222
{
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-
12311223
klp_root_kobj = kobject_create_and_add("livepatch", kernel_kobj);
12321224
if (!klp_root_kobj)
12331225
return -ENOMEM;

0 commit comments

Comments
 (0)