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

+3 -58
-2
MAINTAINERS
··· 11434 F: Documentation/ABI/testing/sysfs-kernel-livepatch 11435 F: Documentation/livepatch/ 11436 F: arch/powerpc/include/asm/livepatch.h 11437 - F: arch/s390/include/asm/livepatch.h 11438 - F: arch/x86/include/asm/livepatch.h 11439 F: include/linux/livepatch.h 11440 F: kernel/livepatch/ 11441 F: kernel/module/livepatch.c
··· 11434 F: Documentation/ABI/testing/sysfs-kernel-livepatch 11435 F: Documentation/livepatch/ 11436 F: arch/powerpc/include/asm/livepatch.h 11437 F: include/linux/livepatch.h 11438 F: kernel/livepatch/ 11439 F: kernel/module/livepatch.c
+1 -9
arch/powerpc/include/asm/livepatch.h
··· 7 #ifndef _ASM_POWERPC_LIVEPATCH_H 8 #define _ASM_POWERPC_LIVEPATCH_H 9 10 - #include <linux/module.h> 11 - #include <linux/ftrace.h> 12 #include <linux/sched/task_stack.h> 13 - 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 21 #ifdef CONFIG_LIVEPATCH_64 22 static inline void klp_init_thread_info(struct task_struct *p)
··· 7 #ifndef _ASM_POWERPC_LIVEPATCH_H 8 #define _ASM_POWERPC_LIVEPATCH_H 9 10 + #include <linux/sched.h> 11 #include <linux/sched/task_stack.h> 12 13 #ifdef CONFIG_LIVEPATCH_64 14 static inline void klp_init_thread_info(struct task_struct *p)
-1
arch/powerpc/kernel/irq.c
··· 63 #include <asm/machdep.h> 64 #include <asm/udbg.h> 65 #include <asm/smp.h> 66 - #include <asm/livepatch.h> 67 #include <asm/hw_irq.h> 68 #include <asm/softirq_stack.h> 69
··· 63 #include <asm/machdep.h> 64 #include <asm/udbg.h> 65 #include <asm/smp.h> 66 #include <asm/hw_irq.h> 67 #include <asm/softirq_stack.h> 68
+1 -1
arch/powerpc/kernel/setup_64.c
··· 60 #include <asm/udbg.h> 61 #include <asm/kexec.h> 62 #include <asm/code-patching.h> 63 - #include <asm/livepatch.h> 64 #include <asm/opal.h> 65 #include <asm/cputhreads.h> 66 #include <asm/hw_irq.h>
··· 60 #include <asm/udbg.h> 61 #include <asm/kexec.h> 62 #include <asm/code-patching.h> 63 + #include <asm/ftrace.h> 64 #include <asm/opal.h> 65 #include <asm/cputhreads.h> 66 #include <asm/hw_irq.h>
-22
arch/s390/include/asm/livepatch.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0+ */ 2 - /* 3 - * livepatch.h - s390-specific Kernel Live Patching Core 4 - * 5 - * Copyright (c) 2013-2015 SUSE 6 - * Authors: Jiri Kosina 7 - * Vojtech Pavlik 8 - * Jiri Slaby 9 - */ 10 - 11 - #ifndef ASM_LIVEPATCH_H 12 - #define ASM_LIVEPATCH_H 13 - 14 - #include <linux/ftrace.h> 15 - #include <asm/ptrace.h> 16 - 17 - static inline void klp_arch_set_pc(struct ftrace_regs *fregs, unsigned long ip) 18 - { 19 - ftrace_instruction_pointer_set(fregs, ip); 20 - } 21 - 22 - #endif
···
-20
arch/x86/include/asm/livepatch.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * livepatch.h - x86-specific Kernel Live Patching Core 4 - * 5 - * Copyright (C) 2014 Seth Jennings <sjenning@redhat.com> 6 - * Copyright (C) 2014 SUSE 7 - */ 8 - 9 - #ifndef _ASM_X86_LIVEPATCH_H 10 - #define _ASM_X86_LIVEPATCH_H 11 - 12 - #include <asm/setup.h> 13 - #include <linux/ftrace.h> 14 - 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 - 20 - #endif /* _ASM_X86_LIVEPATCH_H */
···
-2
include/linux/livepatch.h
··· 16 17 #if IS_ENABLED(CONFIG_LIVEPATCH) 18 19 - #include <asm/livepatch.h> 20 - 21 /* task patch states */ 22 #define KLP_UNDEFINED -1 23 #define KLP_UNPATCHED 0
··· 16 17 #if IS_ENABLED(CONFIG_LIVEPATCH) 18 19 /* task patch states */ 20 #define KLP_UNDEFINED -1 21 #define KLP_UNPATCHED 0
+1 -1
kernel/livepatch/patch.c
··· 118 if (func->nop) 119 goto unlock; 120 121 - klp_arch_set_pc(fregs, (unsigned long)func->new_func); 122 123 unlock: 124 ftrace_test_recursion_unlock(bit);
··· 118 if (func->nop) 119 goto unlock; 120 121 + ftrace_instruction_pointer_set(fregs, (unsigned long)func->new_func); 122 123 unlock: 124 ftrace_test_recursion_unlock(bit);