Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
Merge tag 'livepatching-for-5.19' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/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
  • Loading branch information
torvalds committed Jun 2, 2022
2 parents 12831f6 + 5d7c854 commit 7c9e960
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 58 deletions.
2 changes: 0 additions & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -11434,8 +11434,6 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.g
F: Documentation/ABI/testing/sysfs-kernel-livepatch
F: Documentation/livepatch/
F: arch/powerpc/include/asm/livepatch.h
F: arch/s390/include/asm/livepatch.h
F: arch/x86/include/asm/livepatch.h
F: include/linux/livepatch.h
F: kernel/livepatch/
F: kernel/module/livepatch.c
Expand Down
10 changes: 1 addition & 9 deletions arch/powerpc/include/asm/livepatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,9 @@
#ifndef _ASM_POWERPC_LIVEPATCH_H
#define _ASM_POWERPC_LIVEPATCH_H

#include <linux/module.h>
#include <linux/ftrace.h>
#include <linux/sched.h>
#include <linux/sched/task_stack.h>

#ifdef CONFIG_LIVEPATCH
static inline void klp_arch_set_pc(struct ftrace_regs *fregs, unsigned long ip)
{
ftrace_instruction_pointer_set(fregs, ip);
}
#endif /* CONFIG_LIVEPATCH */

#ifdef CONFIG_LIVEPATCH_64
static inline void klp_init_thread_info(struct task_struct *p)
{
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
#include <asm/machdep.h>
#include <asm/udbg.h>
#include <asm/smp.h>
#include <asm/livepatch.h>
#include <asm/hw_irq.h>
#include <asm/softirq_stack.h>

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#include <asm/udbg.h>
#include <asm/kexec.h>
#include <asm/code-patching.h>
#include <asm/livepatch.h>
#include <asm/ftrace.h>
#include <asm/opal.h>
#include <asm/cputhreads.h>
#include <asm/hw_irq.h>
Expand Down
22 changes: 0 additions & 22 deletions arch/s390/include/asm/livepatch.h

This file was deleted.

20 changes: 0 additions & 20 deletions arch/x86/include/asm/livepatch.h

This file was deleted.

2 changes: 0 additions & 2 deletions include/linux/livepatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

#if IS_ENABLED(CONFIG_LIVEPATCH)

#include <asm/livepatch.h>

/* task patch states */
#define KLP_UNDEFINED -1
#define KLP_UNPATCHED 0
Expand Down
2 changes: 1 addition & 1 deletion kernel/livepatch/patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static void notrace klp_ftrace_handler(unsigned long ip,
if (func->nop)
goto unlock;

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

unlock:
ftrace_test_recursion_unlock(bit);
Expand Down

0 comments on commit 7c9e960

Please sign in to comment.