Skip to content

Commit 7c9e960

Browse files
committed
Merge tag 'livepatching-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching
Pull livepatching cleanup from Petr Mladek: - Remove duplicated livepatch code [Christophe] * tag 'livepatching-for-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching: livepatch: Remove klp_arch_set_pc() and asm/livepatch.h
2 parents 12831f6 + 5d7c854 commit 7c9e960

File tree

8 files changed

+3
-58
lines changed

8 files changed

+3
-58
lines changed

MAINTAINERS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11434,8 +11434,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.g
1143411434
F: Documentation/ABI/testing/sysfs-kernel-livepatch
1143511435
F: Documentation/livepatch/
1143611436
F: arch/powerpc/include/asm/livepatch.h
11437-
F: arch/s390/include/asm/livepatch.h
11438-
F: arch/x86/include/asm/livepatch.h
1143911437
F: include/linux/livepatch.h
1144011438
F: kernel/livepatch/
1144111439
F: kernel/module/livepatch.c

arch/powerpc/include/asm/livepatch.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,9 @@
77
#ifndef _ASM_POWERPC_LIVEPATCH_H
88
#define _ASM_POWERPC_LIVEPATCH_H
99

10-
#include <linux/module.h>
11-
#include <linux/ftrace.h>
10+
#include <linux/sched.h>
1211
#include <linux/sched/task_stack.h>
1312

14-
#ifdef CONFIG_LIVEPATCH
15-
static inline void klp_arch_set_pc(struct ftrace_regs *fregs, unsigned long ip)
16-
{
17-
ftrace_instruction_pointer_set(fregs, ip);
18-
}
19-
#endif /* CONFIG_LIVEPATCH */
20-
2113
#ifdef CONFIG_LIVEPATCH_64
2214
static inline void klp_init_thread_info(struct task_struct *p)
2315
{

arch/powerpc/kernel/irq.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
#include <asm/machdep.h>
6464
#include <asm/udbg.h>
6565
#include <asm/smp.h>
66-
#include <asm/livepatch.h>
6766
#include <asm/hw_irq.h>
6867
#include <asm/softirq_stack.h>
6968

arch/powerpc/kernel/setup_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
#include <asm/udbg.h>
6161
#include <asm/kexec.h>
6262
#include <asm/code-patching.h>
63-
#include <asm/livepatch.h>
63+
#include <asm/ftrace.h>
6464
#include <asm/opal.h>
6565
#include <asm/cputhreads.h>
6666
#include <asm/hw_irq.h>

arch/s390/include/asm/livepatch.h

Lines changed: 0 additions & 22 deletions
This file was deleted.

arch/x86/include/asm/livepatch.h

Lines changed: 0 additions & 20 deletions
This file was deleted.

include/linux/livepatch.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#if IS_ENABLED(CONFIG_LIVEPATCH)
1818

19-
#include <asm/livepatch.h>
20-
2119
/* task patch states */
2220
#define KLP_UNDEFINED -1
2321
#define KLP_UNPATCHED 0

kernel/livepatch/patch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static void notrace klp_ftrace_handler(unsigned long ip,
118118
if (func->nop)
119119
goto unlock;
120120

121-
klp_arch_set_pc(fregs, (unsigned long)func->new_func);
121+
ftrace_instruction_pointer_set(fregs, (unsigned long)func->new_func);
122122

123123
unlock:
124124
ftrace_test_recursion_unlock(bit);

0 commit comments

Comments
 (0)